“This was a situation that could have and should have been avoided,” the four-time U.S. Olympian wrote. “I accept responsibility for my role in this happening and have learned some valuable lessons.”

The 32-year-old Lochte, winner of a dozen Olympic medals during his career, said he didn’t want to speak publicly about Sunday’s incident until learning his three teammates would be returning to the U.S.

Gold medalist Jimmy Feigen was given the go-ahead Friday for a return home after making a $10,800 donation to a Rio charity where needy kids receive martial arts instruction.

Ryan Lochte is swimming in seething global resentment.

(Martin Meissner/AP)

Prosecutors later appealed the decision and proposed upping the fine to an eye-popping $47,000.

Feigen’s passport was returned by authorities, and he intends to retire and attend law school in Texas.

Under Brazilian law, charitable donations can be used to avoid criminal prosecution for minor charges. It’s unclear what officials might do with Lochte — although they called for a public apology.

The other half of their boozy quartet, swimmers Jack Conger and Gunnar Bentz, cooperated with police and threw former reality show star Lochte under the bus as the architect of the fictional robbery tale.

The duo were given the all-clear to depart two days after authorities plucked them out of line as they waited for a flight home at the Rio airport.

The pair were “heard only as witnesses. This has to be made very, very clear,” said lawyer Sergio Riera. “”

Bentz issued a statement Friday night through the University of Georgia, where he is a student, squarely placing all the blame on Lochte.

In a detailed account, he said Lochte “pulled to the ground a framed metal advertisement that was loosely anchored to the brick wall” and claimed “Ryan and the security guards had a heated verbal exchange.”

The bizarre second week of the Olympics, with Lochte in the middle, marked the biggest splash the veteran swimmer made in Rio. His lone medal, while gold, came as a member of the 4x200-meter relay team.

In his only solo event, Lochte finished a disappointing fifth.

The fallout for the hard-partying Lochte could include sanctions from the U.S. Olympic Committee The USOC denied a CNN report Friday that he would be suspended by USA Swimming and the U.S. Olympic Committee.

The loss of their support would create some financial hardships for Lochte if he goes ahead with plans to swim in the 2020 Games.

Lochte's Olympic swimmer pals Jack Conger and Gunnar Bentz were held in Brazil after Lochte ran for the hills following the debacle.

Lochte’s sponsors, including huge brands like Speedo and Ralph Lauren, have yet to comment publicly about the alcohol-fueled escapades.

His behavior already drew attention away from the staggering success of the American swimmers, with 33 medals overall and 16 golds.

But the odds are almost nil that Brazilian officials will attempt to extradite Lochte to face charges of “false communication of a crime” — which carries up to six months in prison.

Lochte left Brazil on Wednesday before local authorities exposed his story of a robbery at gunpoint inside a cab as completely untrue.

“It’s traumatic to be out late with your friends in a foreign country — with a language barrier — and have a stranger point a gun at you and demand money to let you leave,” Lochte spun in his apology.

“But regardless of the behavior of anyone else that night, I should have been much more responsible in how I handled myself.”

Daily News front page for August 19.

(New York Daily News)

The guns were pulled by security guards summoned after the four Americans vandalized a gas station bathroom, breaking its door and tearing down a sign — and then urinating outside, cops said.

The swimmers paid roughly $50 in cash, perhaps in an effort to cover the damage inflicted on the bathroom just outside Rio. Lochte, rather than admitting the robbery tale was a fabrication, said he should have explained more carefully what went on.

“I want to apologize for my behavior last weekend — for not being more careful and candid in how I described the events of that early morning,” Lochte wrote in the first line of his apology.

There was no word Friday from the Lochte camp on whether he will expand on his thoughts, although he hinted this might be the last time he addressed the controversy.

“There has already been too much said and too many valuable resources dedicated to what happened last weekend,” he concluded.

“So I hope we spend our time celebrating the great stories and performances of these Games and look ahead to celebrating future successes.”

American Olympic officials, after initially defending the swimmers, expressed disappointment over the scandal.

“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 USOC said.