Olympic gold medalist swimmer Conor Dwyer announced his retirement on Friday after receiving a 20-month suspension for doping.

Dwyer drew the 20-month ban for having testosterone pellets inserted into his hip. The United States swimmer tested positive on three separate occasions from Nov. 15 to Dec. 20 of 2018, which means that he wouldn't have been able to compete in the 2020 Olympics in Tokyo.

"Regardless of the result of the arbitration ruling, I have decided to retire from swimming to pursue other professional interests," Dwyer said in a post on his Instagram account.

A three-person arbitration panel heard the case and determined that Dwyer worked with a nutritionist that advised him to have the pellets inserted into his hip. Dwyer's doctor allegedly spoke with an official at the U.S. Olympic and Paralympic Committee, who said that the pellets were legal.

However, neither Dwyer's doctor or Dwyer himself ever spoke with the U.S. Anti-Doping Agency (USADA), which has a list of banned substances that are available to the public and there's also a hotline available to ask questions regarding what's legal and what isn't. "It's frustrating that Mr. Dwyer did not take advantage of this support, and hopefully, this case will convince others to do so in order to protect fair and healthy competition for all athletes," USADA CEO Travis Tygart told The Associated Press.

Dwyer received a slightly smaller ban based on the fact that he claimed to use the pellets for health reasons rather than performance.

The American swimmer won gold medals in the 2012 and 2016 Olympics. Dwyer competed as part of the 4x200 relay teams in the 2012 Games in London and the 2016 Games in Rio de Janeiro.