Former track rider Iljo Keisse, a Belgian who rides for Etixx-QuickStep, won the final stage from Torino to Milan after outsprinting fellow breakaway rider Luke Durbridge of Australia.
"It's the biggest win of my career! It's amazing," said a visibly shaken Keisse after finishing a tough 98th edition in the best way possible.
But all eyes were on Tinkoff team leader Contador as he maintained his bid to achieve the rare feat of emulating deceased Italian Marco Pantani, the last cyclist to win the Giro and Tour de France in the same year, in 1998.
After three dramatic weeks of racing which saw the retirement of Australian contender Richie Porte (Team Sky), Contador deflected challenges late in the race from Astana pair Fabio Aru and Mikel Landra to finish with a comfortable winning margin.
"I knew it would be a very demanding Giro, but I didn't think it would be so complicated," said Contador, who took the race leader's jersey on stage five before suffering a crash and a dislocated shoulder.
After holding up three fingers on the podium on Saturday, Contador admitted he considers still to be the 2011 champion - a title he was stripped of, along with his 2010 Tour de France crown, after testing positive for clenbuterol.
"People watching on TV, the riders, the fans...everyone knows it's my third victory," said Contador.
The Spaniard may have failed to win a stage throughout, but the former two-time Tour de France winner and three-time Tour of Spain champion finished comfortably ahead of Aru to clinched his second pink jersey after his maiden Giro win in 2008.
Astana team leader Aru, the winner of two key mountain stages, was second overall at 1min 53sec while teammate Landa, also a two-time stage winner, was third at 3:05.
Astana's stage successes and podium places will help soothe the pain of the intense doping scrutiny, following a string of positive results last year, that threatened their existance at the top echelons of the sport.
But despite a strong performance in the second half of the race, Astana ultimately failed to deflect Contador from his goal of emulating Pantani, the man he called earlier in the race his "childhood inspiration".
Nevertheless, Contador can count himself lucky to finish the race at all given mid-race drama which almost derailed his dream of a rare double.
Contador first took the race lead on stage five's summit finish to Abetone, where Jan Polanc took the win, but dislocated his shoulder the next day after crashing on the home straight.
Remarkably, Contador finished the stage but dislocated his shoulder again before the podium presentation, forcing the Spaniard into a painful defence of his lead over the following days before giving it up to Aru in the wake of another spill.
On what appeared an easy day of racing, Contador was involved in a crash outside the 3km 'safety zone' at each race finish on stage 13, finishing sufficiently in arrears to give the lead to Aru.
Contador took the pink jersey back in defiant fashion the following day with a solid, third-place finish in the stage 14 time-trial to leave Aru trailing by several minutes.
It would prove a key performance ahead of ensuing mountain stages in which Contador, at times, was left isolated and under threat from Astana pair Aru and Landa as they set out to destabilise the Spaniard.
Despite a few shaky moments, Contador affirmed his superiority with a stunning performance on the climb to the Passol del Mortirolo on stage 16 when Aru lost another two minutes and Landa, momentarily, became Contador's biggest danger.
Aru's wins on stages 19 and 20 made slight amends for his lack of bite at key moments, notably the time-trial, but the Italian's efforts were too little too late.