PARIS (AP) — Alberto Contador won the doping-scarred Tour de France on Sunday, a new, young and unlikely winner for the three-week race shaken to its core by scandals.

The 24-year-old rider for the Discovery Channel team was the youngest champion since Jan Ullrich of Germany in 1997. He was the first Spaniard to stand on the winner’s podium since the last of Miguel Indurain’s five titles in 1995.

His margin of victory — just 23 seconds ahead of Cadel Evans of Australia — was the second-narrowest in the Tour’s 104-year history, even after 2,200 miles of racing through Britain, Belgium, Spain and France.

“I think we’ve seen the future of Spanish cycling and perhaps international cycling,” seven-time Tour winner Lance Armstrong said.

Contador had seemed destined for second place until the Tour was hit by a bombshell just five days from the finish: the ouster of race leader Michael Rasmussen. His Rabobank team accused the Dane of having lied about his whereabouts before the Tour to evade doping controls.

Rasmussen’s departure catapulted Contador into the race lead, Evans to the runner-up spot, and U.S. rider Levi Leipheimer into third. Those standings held through the closing four days — including a thrilling time trial Saturday that Leipheimer won and the 91-mile final ride Sunday to Paris’ fan-lined Champs-Elysees from Marcoussis, west of the capital. The stage was won by Daniele Bennati of Italy.

Contador high-fived and hugged his teammates after crossing the line. His original goal was to take the white jersey for the best young rider. In the end, he got both white and yellow jerseys.