He had been suffering from headaches for several days beforehand and was diagnosed with a cerebral cavernoma, a congenital vascular disorder, for which he underwent risky surgery and a recovery to get back on his bike.
[12] Contador started to train again at the end of November 2004[13] and eight months after the surgery he won the fifth stage of the 2005 Tour Down Under racing for Liberty Seguros–Würth, as the team previously known as ONCE had become.
[16] Contador returned to racing in the Vuelta a Burgos but he crashed after finishing fifth in stage 4, when he was riding back down to the team bus, and briefly lost consciousness.
Discovery Channel effectively wore down the remnants of the race leader Davide Rebellin's Gerolsteiner team, allowing Contador to launch an attack on the final climb.
He stated that he entered the race in order to gain more experience on his new Trek time trial bike, but he came away with a convincing victory over Sánchez, the defending champion, winning by 37 seconds.
Contador won Stage 15 of the Tour de France by soloing to the finish line more than a minute ahead of most of his closest general classification competitors, and in so doing took the yellow jersey.
[56] On 21 February, Contador won his first race of the season, the Volta ao Algarve, by winning its queen stage and finishing second in the final time trial.
[73] Contador aimed to become the first rider to win both the Giro d'Italia and the Tour de France in the same year since Marco Pantani accomplished the feat in 1998.
[74] On the sixteenth stage to Gap, Contador attacked on the ascent of the Col de Manse, with Cadel Evans and Samuel Sánchez joining him in taking a time advantage over the other favourites in the general classification, including more than a minute over Schleck.
In the stage to the Col du Galibier he lost time to the other favourites after Schleck launched a solo attack 60 kilometres (37 miles) from the finish and Contador was later unable to follow the pace set by Evans.
Contador launched another attack on the first kilometres of Alpe d'Huez but he was eventually beaten to victory by Pierre Rolland with Samuel Sánchez second.
[77] Contador finished fifth in the overall classification, 3 minutes 57 seconds behind Evans, bringing an end to his streak of winning six consecutive Grand Tours that he entered.
[79] On 8 June it was announced that Contador would rejoin Saxo Bank–Tinkoff Bank upon the completion of his ban, signing a contract that would keep him with the team until the end of the 2015 season.
[87] On the next day, Contador crossed the finish line in Madrid with the race leader's red jersey, earning the second Vuelta victory of his career.
[89] For the road race, Contador rode in support of his Spanish teammates[90] and finished 53 seconds in arrears of the victor, Belgian Philippe Gilbert.
It was the first time in his career that he won a single-day race, and he dedicated the event to the memory of Víctor Cabedo, a young professional cyclist who died in a training accident a week prior.
He showed his improving form on the next mountain stage to Valdelinares, attacking with around 2 kilometres (1.2 miles) to go while dropping Froome and Valverde among others as he sat 3 seconds behind red jersey holder Quintana before the individual time trial.
He stayed in his rival's wheel before putting on a finishing kick with around 800 metres (2,600 feet) to go, winning the stage and strengthening his hold on the red jersey.
In mid-March, Contador finished fifth overall at Tirreno–Adriatico, helping his teammate Peter Sagan win stage 6 by accelerating on a climb and shedding the pure sprinters off the leading group.
However, on stage 13, on what most assumed was an "easy day" of racing, Contador crashed in a pile-up, 3.2 kilometres (2.0 miles) from the finish; he crossed the line 42 seconds behind the peloton, including Aru.
Still, Contador made contact with Aru at the Mortirolo Pass and put another two minutes into his rival as Mikel Landa became the second-placed rider on the general classification.
[130] He went on to claim runner-up finishes in Paris–Nice, where he attacked race leader Geraint Thomas from 50 kilometres (31 miles) out and again on the final climb of Col d'Èze before Thomas closed the gap on the final descent to the finish line,[131] and the Volta a Catalunya,[132] before taking the general classification and the stage six time trial at the Tour of the Basque Country, subsequently stating to the press that he would postpone his retirement for at least another year.
He was in 20th place on the general classification with a deficit of 3 minutes 12 seconds to leader Chris Froome before the ninth stage, where after attempting to make the breakaway at the start of the day, he withdrew from the race, citing a fever which had developed overnight.
In July, Contador rode the Tour de France for the final time, but was unable to challenge for overall victory, finishing ninth overall, 8 minutes and 49 seconds down on the winner, Chris Froome.
[139] After final rosters had been presented for the 2006 Tour de France, Contador and five other members of the Astana–Würth team were barred from competing due to alleged connections with the Operación Puerto doping case.
[143] On 28 July 2007, Le Monde, citing what it claimed was an investigation file to which it had access, stated that Contador's name appeared in several documents found during Operación Puerto.
"[148] On 10 August, Contador publicly declared himself to be a clean rider in face of suspicions about his alleged links to the Operación Puerto blood doping ring.
[154] Several people related to the sport defended Contador saying that there is little benefit from using the drug in the amounts that were discovered and that no one would intentionally take such an easily detectable substance.
[165] In late January 2011, the Royal Spanish Cycling Federation (RFEC) proposed a one-year ban, but it subsequently accepted Contador's appeal and cleared him of all charges.
The UCI and the World Anti-Doping Agency each appealed the RFEC decision independently to the Court of Arbitration for Sport in March 2011, but Contador remained free to ride until the CAS made its ruling.