Spain's Alberto Contador was given a two-year ban by the Court of Arbitration for Sport (CAS) for failing a dope test during the 2010 Tour de France, the International Cycling Union have confirmed.

Contador, a Tour winner in 2007, 2009 and 2010 who tested positive for the banned anabolic agent clenbuterol, is now set to be stripped of his last title which will be handed to Luxembourg's Andy Schleck, with Briton Bradley Wiggins climbing on to the podium in third place and Russian Denis Menchov finishing second.

"In rejecting the defence argument, in particular that the presence of clenbuterol in Alberto Contador's urine sample came from the consumption of contaminated meat, today's ruling confirms the UCI's position," the UCI, who had appealed with the World Anti-Doping Agency (WADA) against the Spanish federation's decision to clear Contador, said in a statement.

"However, the UCI has not derived a sense of satisfaction from the CAS ruling, but rather welcomes the news as the end of a long-running affair that has been extremely painful for cycling."

UCI President Pat McQuaid said: "This is a sad day for our sport. Some may think of it as a victory, but that is not at all the case. There are no winners when it comes to the issue of doping: every case, irrespective of its characteristics, is always a case too many."

Contador, who was awaiting his fate in his home in Pinto with his family and lawyers, is now expected back to competition on 6 August.

The 29-year-old Spaniard, who is also set to lose his 2011 Giro d'Italia title, will therefore miss this year's Tour de France and the London Olympic Games.

Spain's Oscar Pereiro was the last rider to be awarded a Tour victory after the race winner lost his title for failing a dope test, in 2006 when American Floyd Landis was stripped of his title following a positive test for testosterone.

Contador, one of only five men with titles in all three grands Tours, is widely regarded as the greatest cyclist of his generation.

His climbing abilities have made him almost invicible in the three-week stage races, although he finished only fifth in last year's Tour following a troubled preparation and because of a sore knee.

Contador must serve a two-year period of ineligibility starting retroactively on 25 January 25, 2011, minus the period of the provisional suspension served in 2010-2011 (five months and 19 days).

Contador's suspension therefore come to an end on 5 August next.

Bjarne Riis, the owner of Contador's current team Saxo Bank - the Spaniard was riding for Astana at the time of the positive test - said: "After what has been a very tough situation for our team, today we have finally received the result of the CAS hearing in the case regarding Alberto Contador.

"The result was obviously not what we had hoped for, but for now our management team is still in the process of reviewing the ruling and the documentation so we can better understand the decision."

WADA president John Fahey said: "This is an appropriate decision from CAS which represents the effective nature of the World Anti-Doping Code.

"It is regrettable there was some political interference at the first instance process from Spain which inevitably led to the appeal.

"As always, WADA will respect CAS decisions and continue to exercise its right to appeal at CAS any further case when it believes the Code has not been correctly followed."