Brazilian authorities have let two US swimmers leave Rio de Janeiro after they retracted a claim to have been dramatically mugged during the Olympic Games, officials say.

Gunnar Bentz and Jack Conger were given back their confiscated passports and "recently departed Rio", US Olympic Committee chief executive Scott Blackmun said in a statement.

The US Olympic chief apologised "to our hosts in Rio and the people of Brazil", saying that the behaviour of the swimmers was "not acceptable" and that "potential consequences" would be decided later.

READ MORE: Rio police say US Olympic swimmers were not robbed

As they left late on Thursday, local crowds jeered at them, calling them "liars" and "fakes".

A third swimmer, James Feigen, has also given police a revised statement about the apparently invented mugging story "with the hope of securing the release of his passport as soon as possible", Blackmun said.

Feigen will pay $11,000 to a Brazilian charity to settle the dispute, ABC reported. 

The fourth, swimming superstar, Ryan Lochte, was already back in the US when the scandal erupted.

A Brazilian judge on Wednesday ordered all four swimmers to stay in Brazil while their story was investigated.

Major stir

Lochte said last Sunday that the four were victims of a robbery by at least one armed attacker posing as a Rio policeman.

The claim caused a major stir at the Olympics and forced Brazilian authorities to apologise for what appeared to be a security lapse.

Brazilian police, though, said on Thursday that the athletes were drunk and got into an altercation with security staff after vandalising a petrol station where they stopped in a taxi to use the toilet.

Blackmun indicated that the athletes, questioned by police on Thursday, had recanted and confirmed the police version of the incident.

Follow our coverage of the Rio 2016 Olympics

"They stopped at a gas [petrol] station to use the restroom, where one of the athletes committed an act of vandalism," the statement said.

"An argument ensued between the athletes and two armed gas station security staff, who displayed their weapons, ordered the athletes from their vehicle and demanded the athletes provide a monetary payment. Once the security officials received money from the athletes, the athletes were allowed to leave."

Al Jazeera's Gabriel Elizondo, reporting from Rio, said: "Surveillance video of that night shows none of the atheles - all of whom admitted to being intoxicated - were robbed.

"It [their claim] made headlines around the world. Now that it's been proven false, may Brazilians are puzzled and angry."

The punishment for falsely reporting a crime in Brazil is either a six-month sentence or a fine.

Rio 2016: Empty seats as spectators find alternative ways to watch for free

Source: Al Jazeera and agencies