Basso crosses the finish line in Verona's ancient Roman amphitheatre
Italian Ivan Basso avoided trouble in the concluding time-trial to win his second Giro d'Italia title.
Basso, who claimed the pink jersey in the mountains on Friday, finished 1 minute 51 seconds ahead of David Arroyo, with Vincenzo Nibali third.
It was 32-year-old Basso's first major race win since returning following a two-year doping ban in 2007.
Sweden's Gustav Erik Larsson won the final 15km (9.3-mile) stage around Verona in 20 minutes, 19 seconds.
"I'm delighted, it was a really tough Giro," said Basso after crossing the line at the packed Verona Arena, an ancient Roman amphitheatre, to take 15th place on the time-trial and complete his 87 hours 44 minutes and one second race.
"This victory is something fantastic, it was a spectacular Giro that was tense right to the end."
Basso was banned for two years in 2007 for his involvement in Spain's Operacion Puerto doping scandal. He claimed he had not actually taken banned substances but, instead, said he had intended to do so.
The 32-year-old, who denied his 2006 Giro win was aided by doping, has been largely forgiven by Italian cycling fans for his misdemeanour and Sunday's victory completed his turnaround in fortunes.
Arroyo's previous best Giro finish was 10th in 2007
Friday's epic 195km stage in the Italian Alps had proved crucial for Basso as he finished second, over three minutes ahead of then-leader Arroyo, to seize the pink jersey from the Caisse d'Epargne rider, a surprise package in this year's race.
And when he extended his overall lead by 24 seconds to 1:15 over the 30-year-old Spaniard after Saturday's final climb, victory was all but assured for Basso.
He came in 42 seconds slower than winner Larsson, of the Saxo Bank team, as Arroyo lost more groundt to finish 47th, 1:18 off the pace.
Basso's Liquigas team-mate Vincenzo Nibali had started the stage one second ahead of compatriot Michele Scarponi, as the former's superior ability on the descent on the time-trial saw him finish 12 seconds quicker than his rival to claim third.
Fifth place went to Australian world road race champion Cadel Evans.
Team Sky rider Bradley Wiggins, whose overall challenge had faded after a disastrous stage 15, ended the British team's Giro debut on something of a high, finishing seventh in the time-trial, 29 seconds slower than Larsson.
Dario Cioni was Team Sky's highest-placed rider in the overall standings in 17th, with Wiggins in 35th, one hour and 10 minutes behind.
Defending Tour de France champion Alberto Contador and seven-time Le Tour winner Lance Armstrong skipped the Italian tour to concentrate on cycling's showpiece, which begins on 3 July in Rotterdam.
Stage 21 results:
1. Erik Gustav Larsson (Sweden, Saxo Bank) 20 mins 19 secs
2. Marco Pinotti (Italy, Columbia) 2 secs behind
3. Alexandre Vinokourov (Kazakhstan, Astana) +0:17
4. Cadel Evans (Australia, BMC) +0:22
5. Vincenzo Nibali (Italy, Liquigas) +0:23
6. Ignatas Konovalovas (Lithuania, Cervelo) +0:23
7. Bradley Wiggins (Britain, Sky) +0:29
8. Cameron Meyer (Australia, Garmin) +0:32
9. Michele Scarponi (Italy, Androni) +0:35
10. Tom Stamsnijder (Netherlands, Rabobank) +0:37
Final overall standings:
1. Ivan Basso (Italy, Liquigas) 87hrs 44 mins, 1 sec
2. David Arroyo Duran (Spain, Caisse d'Epargne) 1min 51 secs behind
3. Vincenzo Nibali (Italy, Liquigas) +2:37
4. Michele Scarponi (Italy, Androni) +2:50
5. Cadel Evans (Australia, BMC) +3:27
6. Alexandre Vinokourov (Kazakhstan, Astana) +7:06
7. Richie Porte (Australia, Saxo Bank) +7:22
8. Carlos Sastre (Spain, Cervelo) +9:39
9. Marco Pinotti (Italy, Columbia) +14:20
10. Robert Kiserlovski (Croatia, Liquigas) +14:51