Last updated on .From the section Swimming

Ryan Lochte has won 12 Olympic medals - including six golds

A court in Brazil has dismissed charges against US swimmer Ryan Lochte relating to false robbery claims he made at the Rio Olympics.

Lochte, 32, had told a TV interview that he and three other members of the US swimming team had been robbed at gunpoint at a petrol station.

Brazilian police later determined, partly based on CCTV footage, that Lochte had largely made up the story.

He was charged with making a false statement and banned from swimming.

But an appeal court in Rio de Janeiro has thrown out the case, the Associated Press reports, external-link saying Lochte's robbery claims "did not rise to the level of filing a false crime report". This is because the claim was made to a broadcaster and not to police.

"We are pleased that the court has finally dismissed the criminal prosecution against Mr Lochte, while also acknowledging that he committed no crime while in Brazil," Lochte's lawyer Jeff Ostrow told USA Today. external-link

Prosecutors can still appeal against the court's decision but Ostrow added: "We are hopeful that the prosecution accepts the court's decision so that this story can finally be put to rest."

Lochte is one of the most successful swimmers in history, with 12 Olympic medals - including six golds.

He swam in two events in Rio, winning gold in the 4x200m freestyle relay.

What happened in Rio?

Lochte and team-mates Gunnar Bentz, Jack Conger and Jimmy Feigen had been out celebrating the end of the swimming competition on August 15, 2016.

Lochte later said in an interview with NBC that they were robbed at gunpoint in a taxi by men with a police badge as they returned to the Olympic village from a party.

But police investigating the case said they have found no evidence of the robbery. They also pointed to "inconsistencies" in the swimmers' accounts.

Video showed the athletes getting into a confrontation with security guards at a petrol station and Lochte later apologised for his behaviour.

Lochte and Feigen were ordered to stay in Brazil to face questions but Lochte had already returned to the US.

Lochte was banned by the US swimming team for his behaviour, a suspension that expired on June 30, 2017, and he missed the US World Championship trials.

Lochte was also dropped by four of his major sponsors, including Speedo USA and Ralph Lauren.

Bentz and Conger were pulled off a US-bound plane by police, though they were subsequently allowed to leave after questioning.

Feigen agreed to pay $11,000 (£8,250) to a Brazilian charity after he was allowed to return home.

All three were each banned from swimming for four months.

Lochte is now preparing to return to competitive swimming but pulled out of this weekend's Los Angeles Invitational.

"It's been a long suspension but it's over," Lochte tweeted on 1 July. "I've learned and became a better man from it."