The Quick-Step Floors ace completed the stage in 3:04:40 after sneaking past Germany’s Phil Bauhaus (Team Sunweb) and Australia’s Caleb Ewan (Mitchelton-Scott) in the sprint to the finish.
Viviani, who had moved to the Belgium team from Team Sky in the off-season, said he had not expected a win so early in the cycling season.
South African Nicholas Dlamini (Dimension Data) grabbed the King of the Mountains title again, making it three out of three.
DiData’s sport director Alex Sans Vega said the team had followed the same strategy they had used in the previous stages.
“The King of the Mountains was again early in the stage and Nic made the break to collect more points.
“After the climb, he rode on in the break a bit farther as there was a tailwind and he wasn’t using any extra energy.
“But when the peloton started pulling harder for the bonus sprints it made sense for Nic to drop back.”
Ewan maintains the overall lead with a time of 10:58:36. Viviani follows 10 seconds later with South African Daryl Impey in third and 14 seconds behind teammate Ewan.
Stage four will be over 128.2km from Norwood to Uraidla.
Stage three results
1. Elia Viviani (Quick-Step Floors, Italy) 3:04:40
2. Phil Bauhaus (Team Sunweb, Germany)
3. Caleb Ewan (Mitchelton-Scott, Australia)
4. Simone Consonni (UAE Team Emirates, Italy)
5. Peter Sagan (Bora-hansgrohe, Slovakia)
6. Simon Clarke (Team EF Eductaion First-Drapac p/b Cannondale, Australia)
7. Alexander Edmondson (Mitchelton-Scott, Australia)
8. Zak Dempster (UniSA-Australia, Australia)
9. Dries Devenyns (Quick-Step Floors, Belgium)
10. Jay McCarthy (Bora-hansgrohe, Italy)
1. Caleb Ewan (Mitchelton-Scott, Australia) 10:58:36
2. Elia Viviani (Quick-Step Floors, Italy) +10″
3. Daryl Impey (Mitchelton-Scott, South Africa) +14″
4. Jay McCarthy (Bora-hansgrohe, Australia) +15″
5. Peter Sagan (Bora-hansgrohe, Slovakia) +16″
6. Nathan Haas (Team Katusha-Alpecin, Australia) +17″
7. Jhonatan Restrepo (Team Katusha-Alpecin, Columbia) +19″
8. Simone Consonni (UAE Team Emirates, Italy) +20″
9. Maarten Wynants (Team Lotto NL-Jumbo, Belgium)
10. Anthony Roux (FDJ, France)