He began 2012 in strong form. First he walked an Italian record of 1:17:30 hours to win at the Memorial Mario Albisetti 20 km walk, then he had the fourth best 50 km time of his career a week later to win at the Dudinska patdesiatka.
Schwazer was excluded from the 2012 Summer Olympics in London after an "adverse result" from a doping test. Schwazer said "My career is finished...I wanted to be stronger for this Olympics, I made a mistake". He announced his decision to quit athletics and described the result as the "biggest blow of my life". He was subsequently given a three-and-a-half year competition ban by the Italian National Olympic Committee in April 2013. Schwazer's girlfriend at the time of the offence, figure skater Carolina Kostner, later admitted to prosecutors in Bolzano that she had lied to inspectors from the World Anti-Doping Agency shortly before the 2012 Games when they visited her home looking for Schwazer, claiming that he was not there so he could avoid being tested. She also told the prosecutors that Schwazer slept in an altitude chamber, which is not banned by WADA but is illegal in Italy.