The Spaniard, who won all three Grand Tours in a professional career spanning 14 years, made his announcement with a message on a variety of social media channels.
"I am retiring from professional cycling. I say this happy and without sadness," the 34-year-old Contador said.
"It's a decision I have thought over very well and I don't think there is a better farewell than in the race in my country."
"I'm sure they will be three wonderful weeks, enjoying all your affection, and I'm eager that they come."
SBS will broadcast and live stream all stages of the Vuelta a España live from 19 August to 10 September.
Nicknamed El Pistolero for his attacking style and ability to mount devastating attacks in the mountains, Contador won his first Tour de France in 2007 with the Discovery Channel team before moving to Astana and winning it again in 2009.
He also won the 2010 edition but in 2012 was stripped of that title after being banned for two years after testing positive for the banned substance clenbuterol at the race.
Contador, who blamed it on contaminated steak, initially had a one-year ban lifted by the Spanish cycling federation but the Court of Arbitration for Sport (CAS) eventually banned him, backdating it to January 2011 and erasing all his results from July 2010 to February 2012.
He returned later in 2012 to win the Vuelta.
While Contador, who was also stripped of the 2011 Giro d'Italia title, divided opinion within the sport he remained one of the most popular riders among cycling fans.
As well as his Tour triumphs, he won the 2008 and 2015 Giros and the Vuelta in 2008, 2012 and 2014.
In 2015 he announced that he would attempt to become the first rider since Marco Pantani in 1998 to win the Giro and the Tour back-to-back. After winning the Italian race his Tour hopes evaporated as he struggled in the Alps and finished fifth.
Contador joined the Trek-Segafredo team this season and finished ninth in the Tour de France.
His hopes of bowing out with victory in the Vuelta look slim as the race includes Tour winner Chris Froome (Team Sky), Italian Vincenzo Nibali (Bahrain-Merida) and France's Romain Bardet (Ag2r) who was third on the podium in Paris.
"It was great to have him on the team, even it was only for one season, and we will keep giving it our all to help him to achieve a big result in his last Vuelta a España," Trek-Segafredo general manager Luca Guercilena said.
"It goes without saying we wish him the very best for his future afterwards!"