"I accept responsibility," US Olympic swimmer Ryan Lochte says, in an apology about an early-morning incident at a Rio de Janeiro gas station that tainted America's march to gold in the Olympics.

Lochte said in a lengthy post on Instagram Friday that he was sorry for his behavior and should have been more "careful and candid'' in his description of the event, which he first characterized as a robbery. He also apologized for his role in taking the focus away from other Olympic athletes.

"This was a situation that could and should have been avoided," Lochte said. "I accept responsibility for my role in this happening and have learned some valuable lessons."

The statement came a day after US Olympic authorities apologized to Brazil and two US swimmers were allowed to go home having retracted a fabricated story about being mugged in Rio.

A third American swimmer, James Feigen, agreed to pay a donation to a Brazilian charity of nearly $11,000 as a condition to leave the South American nation, ABC reported Friday.

Four US swimmers, including Lochte, have been at the center of a media storm since claiming they were held up at gunpoint after leaving a party early Sunday.

"We apologize to our hosts in Rio and the people of Brazil for this distracting ordeal in the midst of what should rightly be a celebration of excellence," US Olympic Committee CEO Scott Blackmun said in a statement.

Blackmun spoke after Brazilian police let Gunnar Bentz and Jack Conger leave the country. "Their passports have been released and they recently departed Rio," he said.

As for Feigen, he gave police a "revised statement," Blackmun said.

He agreed to a deal in which he would make a hefty donation to an unspecified group in exchange for permission to leave, NBC said.

"After a long deliberation, this agreement was reached ... he will donate [$10,800] to an institute, and with that the case is resolved," the broadcaster cited Feigen's lawyer Breno Melaragno as saying.

"After this donation is done, his passport will be given back to him, and he will be free to return home."

Lochte was already back in the United States when the scandal erupted.

Lochte said on Sunday that the four had been victims of a robbery by at least one armed assailant posing as a Rio policeman.

The claim forced Brazil's Olympics organizers into an apology for the supposed security lapse.

Amid growing doubts, however, a Brazilian judge issued an order Wednesday that all four swimmers be kept in Brazil while the story was probed.

Brazilian police said Thursday the athletes were drunk and got into an altercation with security staff after vandalizing a gas station bathroom during a night on the town.

Blackmun indicated that the athletes, questioned by police Thursday, had confirmed the police version.

"They stopped at a gas station to use the restroom, where one of the athletes committed an act of vandalism," the US 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."

Lies and videotape

Rio de Janeiro's police chief Fernando Veloso called on the athletes to apologize.

He said CCTV footage at the gas station showed a security official pulling his weapon to restrain a drunk and angry Lochte and his teammates because they tried to leave after damaging the bathroom.

"There was no robbery of the kind reported by the athletes," Veloso told a press conference.

"The images do not show any kind of violence against them."

He said police believed the swimmers handed over the equivalent of about $50 in cash to pay for the damage before leaving.

Veloso said it was still not decided what charges, if any, would be brought against the swimmers.

"In theory, they could end up facing charges of falsely reporting a crime and damage to property," he said. Neither offense is punishable by prison.

"It would be noble and dignified of them to apologize. The only thing they told the truth about is that they were drunk."

Rio 2016 Olympics chief spokesman Mario Andrada, who had apologized to the athletes after the supposed robbery, was in forgiving mood Thursday.

"Let's give these kids a break," Andrada told a news conference. "These kids were trying to have fun... They made a mistake, it is part of life."