RIO DE JANEIRO - (AP) -- U.S Olympic swimmer Ryan Lochte has apologized for his behavior surrounding a late-night incident at a Rio de Janeiro gas station, saying he should have been more "careful and candid" about how he described what happened.

Lochte said in a lengthy post on Instagram Friday that he was apologizing for his role in taking the focus away from other Olympic athletes.

The 12-time gold medalist reiterated his view that a stranger pointed a gun at him and demanded money to let him leave. Lochte had called it a robbery; Brazilian police said he and three other swimmers vandalized a gas station bathroom and were confronted by armed security guards.

"I accept responsibility for my role in this happening and have learned some valuable lessons," Lochte said.

Two of the other swimmers, Gunnar Bentz and Jack Conger, were on their way home Friday after being held in the country to testify. The fourth swimmer, Jimmy Feigen, made a deal with a Brazil judge to make a $10,800 payment and be allowed to leave the country later Friday, his lawyer said.

"We accept and appreciate his apology," said Mario Andrada, spokesman for the local organizers of the Rio Games.

The drama surrounding the alleged robbery -- and the ever-changing descriptions of it by the swimmers -- has shocked and deeply angered Brazilians, who said it cast a false negative shadow on their city and their Olympics at a time the country is eager to prove it can host the games safely. The story also dominated Olympic headlines, overshadowing the worthy accomplishments of athletes who trained for years just to get to Rio and set records during their performances. The saga was an enormous embarrassment for the U.S. Olympic team, which has dominated in the medal count.

The rapid-fire developments early Friday came hours after police announced that Lochte and three of his teammates had not been held at gunpoint after a night of partying, as Lochte claimed. Instead, Brazilian police said the men, while intoxicated, vandalized a gas station bathroom and were questioned by armed guards before they paid for the damage and left.

"No robbery was committed against these athletes. They were not victims of the crimes they claimed," Civil Police Chief Fernando Veloso told a news conference.

As Bentz and Conger, were whisked through airport security and onto a plane home Thursday night, their attorney insisted they had nothing to do with Lochte's story. Lochte himself left the country earlier this week.

Bentz and Conger "were heard only as witnesses. This has to be made very, very clear," lawyer Sergio Riera told The Associated Press. "They did not make any untruthful testimony. They did not lie in their statements."

A lawyer for another swimmer, James Feigen, said early Friday that the athlete reached an agreement with a judge in which he planned to donate 35,000 Brazilian reals ($10,800) to an "institution" and leave the country later in the day.

Attorney Breno Melaragno said under the agreement, Feigen will make the donation, get his passport back and depart.

Melaragno did not specify where the money will go, but his use of the term "institution" can be taken to mean a charity. He said that under Brazilian law, a donation can be made to avoid criminal prosecution for minor offenses, but did not say what charge was being contemplated.

Though police appear mostly finished with their probe, the case may be far from settled. Police have said authorities are considering charges of falsely reporting a crime and destruction of property, both of which can carry up to six months in jail or a fine.

Lochte's attorney, Jeff Ostrow, has insisted the story wasn't made up and told the New York Times the surveillance video corroborated the "primary elements" of Lochte's version of events.

"There was a uniformed person with a gun who forced them to hand over their money," Ostrow told the newspaper.

The saga began when Lochte said he and Conger, Bentz and Feigen were held at gunpoint and robbed several hours after the last Olympic swimming races ended. That claim started unraveling when police said that investigators could not find evidence to substantiate it.

Then security video reviewed by police confirmed the athletes vandalized parts of the gas station, leading to an encounter with station employees.

The video shows one of the swimmers pulling a sign off of a wall and dropping it onto the ground. A gas station worker arrives, and other workers inspect the damage. Veloso said the swimmers broke a door, a soap dispenser and a mirror.

The swimmers eventually talk with station workers and their cab leaves. In another sequence, the swimmers appear to briefly raise their hands while talking to someone and sit down on a curb.

After a few minutes, the swimmers stand up and appear to exchange something -- perhaps cash, as police said -- with one of the men.

The footage doesn't show a weapon, but a police official, speaking on condition of anonymity because the investigation was ongoing, said two guards pointed guns at the swimmers. Veloso said the guards did not use excessive force and would have been justified in drawing their weapons because the athletes "were conducting themselves in a violent way."

A station employee called police, and the guards and employees tried to get the swimmers and the taxi driver to stay until authorities arrived, some even offering to help interpret between English and Portuguese, Veloso said. But he said the athletes wanted to leave, so they paid 100 Brazilian reals (about US $33) and $20 in U.S. currency and left.

Police said the swimmers had been unable to provide key details in early interviews, saying they had been intoxicated. The police official said officers grew suspicious when video showed the swimmers returning to the athletes village wearing watches, which would have likely been taken in a robbery.

Bentz and Conger told police that they felt Lochte had lied about the situation in media interviews, according to text of the statements released by Rio police.

"We got pulled over, in the taxi, and these guys came out with a badge, a police badge, no lights, no nothing just a police badge and they pulled us over," Lochte told NBC's "Today" the morning after the incident. "They pulled out their guns, they told the other swimmers to get down on the ground -- they got down on the ground. I refused, I was like we didn't do anything wrong, so -- I'm not getting down on the ground.

"And then the guy pulled out his gun, he cocked it, put it to my forehead and he said, 'Get down,' and I put my hands up, I was like 'whatever.' He took our money, he took my wallet -- he left my cellphone, he left my credentials."

The debacle prompted both wild speculation and social media mockery, which quickly turned to scorn after the official account went public.

David Fleischer, a political scientist at the University of Brasilia, said the incident touched a nerve in Brazil because of the country's history and cases of people committing crimes while impersonating police.

"The story did have some sense of validity but it didn't bear out and it made them look bad worldwide," he said.

That outrage was evident Thursday, as onlookers shouted "liars" and "shameful" at Bentz and Conger as they left a police station where they gave statements.

While he's medaled often, Lochte's accomplishments have long been overshadowed by teammate Michael Phelps -- the most decorated Olympian in history. Lochte, a 12-time medalist, won a gold in Rio in a relay race alongside Phelps.

Lochte and the other swimmers could face sanctions from USA Swimming, including fines or suspension. The group, as well as Olympic officials, publicly expressed disappointment and said they would further examine the matter.

"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," the U.S. Olympic Committee said.

___

AP reporters Cristiana Mesquita, Beth Harris, Chris Lehourites, Pauline Arrillaga and Renata Brito in Rio de Janeiro contributed to this report.