Ryan Lochte explains that even though he didn't use any banned substances, he will accept his suspension until July 2019 for using an IV. (3:02)

FORT LAUDERDALE, Fla. -- Ryan Lochte posted a photo for the world to see, and the U.S. Anti-Doping Agency noticed.

It got him suspended -- again.

The longtime U.S. swimming star has been banned from competition until July 2019, which means the 12-time Olympic medalist cannot compete as planned in the national championships that start this week in California. Lochte will also be ineligible for other top meets, including the Pan Pacific Championships later this year and next year's world championships.

Lochte's offense was that he got an intravenous injection in May -- a method typically banned under anti-doping rules. The 14-month ban, retroactive to May 24 and announced Monday by USADA, is his second in less than two years after his 10-month suspension for his behavior during a drunken incident that created widespread scorn at the 2016 Rio de Janeiro Olympics.

U.S. anti-doping officials said Lochte, who was holding a news conference Monday in South Florida to discuss the matter, was not taking a banned substance.

"I have never taken a prohibitive substance," Lochte said. "I have never attempted to gain any advantage by putting anything illegal in my body. I would never do that; this is very serious to me. ... Unfortunately, while the rule is a newer rule and is not widely known as others, I should know better."

In Brazil, there were questions about his version of what happened.

This time, he revealed what happened -- obviously unaware of the ramifications it would bring.

Lochte's violation essentially came to light when he posted the photo of him getting the IV on his social media accounts. That triggered the USADA investigation, one that Lochte "fully cooperated" with according to U.S. officials.

"Lochte received an intravenous infusion of permitted substances at an infusion clinic," the USADA announcement of the suspension said. Under most circumstances, athletes cannot receive IVs unless related to a hospitalization or when allowed under the terms of a USADA-approved exemption -- and Lochte fell into neither of those categories.

Suspensions for use of an IV are extremely rare: The USADA database shows only two other athletes being sanctioned for using such a method, one of them getting a six-month suspension and the other a 14-month ban. That same database shows that before Monday, no other U.S. swimmer in the past 10 years, for any reason including actual positive tests, had been suspended for more than one year by USADA.

This week could have been a significant step forward for Lochte, who was entered in four events at the U.S. championships at Irvine, California, and was preparing to compete in what would have been his biggest competition since the Rio Games. Lochte said that he and three other U.S. Olympic swimmers there were robbed at gunpoint at a gas station, a story that quickly unraveled.

Lochte was not only suspended 10 months for that debacle, but also forfeited $100,000 in Olympic medal bonus money and was banned from competing in last year's national and world championships.

But the bigger hit was to his reputation.

And now, he's back in hot water. USADA agreed to start the 14-month clock on May 24, the day that he posted the photo which no longer can be found on his Twitter or Instagram pages. He has previously said that he wants to compete in the 2020 Tokyo Olympics, though those hopes would seem to be in at least some doubt now.

"This is devastating for my family and me, and I was finally back in top shape," Lochte said. "I know it sounds like a harsh penalty for something unintentional and where I didn't put anything prohibitive in my body, but a rule is a rule and I accept that there is a technical violation in that I'll have to [accept the consequences].

Lochte said he won't give up on swimming.

"I may be on the sideline from competition, but I'll continue to train every day," he said. "I want nothing more than to earn the privilege to swim for my country in my fifth Olympic Games in Tokyo 2020."

Lochte spent much of his career portraying a party-boy image, while his wildly successful exploits in the pool -- six Olympic golds, 36 world championship gold medals, no fewer than four world records -- were always overshadowed by 28-time Olympic medalist and 23-time Olympic champion Michael Phelps.

After Rio, Lochte was dropped by at least four major sponsors including Speedo USA and Ralph Lauren, although he has added some endorsement deals since. He was also apparently targeted by two men wearing T-shirts bearing an anti-Lochte message who rushed the stage while he was competing on ABC's "Dancing with the Stars."

Lochte returned to competition last year, most notably winning the 200-meter individual medley at the U.S. Open. He also has become a father and a husband since Rio -- he married former Playboy model Kayla Rae Reid in January, seven months after their son was born.

Lochte will turn 36 during the Tokyo Games. He won gold medals at the 2004, 2008, 2012 and 2016 games, and if he were to find a way to win another in Tokyo he would become the oldest Olympic swimming champion.

Information from The Associated Press was used in this report.