(Matt Slocum/Associated Press)

RIO DE JANEIRO — U.S. Olympic swimmer James Feigen has made a donation worth just under $11,000 (35,000 Brazilian reals) to a Brazilian non-profit sporting institution and is now free to leave the country, a Rio court said Friday in a statement.

Following an interview with the swimmer, police had offered a misdemeanor charge against him for false communication of a robbery on the evening of Aug. 19.

In the early hours of Friday morning, a special Olympic court had agreed that if Feigen made the donation to a non-profit institute, he could recover his passport and leave the country. On Friday, Feigen was able to prove he had made the donation to the Reaction Institute, a non-profit organization in West Rio where Rafaela Silva, the Brazilian judo fighter who won an Olympic gold, trained. The institution was set up by Brazilian judo Olympian Flavio Canto.

Officer Marcelo Carregosa, who is second in charge of the special tourist police station in Rio that is dealing with the case, said that under special rules drawn up for the Olympics, a plea bargain could be made for minor crimes where the maximum penalty was less than two years in jail.

“As it is a less serious crime, with a penalty of less than two years of prison, he has the right to a plea bargain. So a plea bargain was done for the value of 35,000 Brazilian reals,” Carregosa told The Post in an interview. “These are special rules of the special court.”

U.S. Olympic gold medallist Jimmy Feigen has paid $11,000 to charity to get his passport back and is free to go, a Brazilian judge says, after a scandal over a false robbery report. (Reuters)

Had the owner of the gas station pressed charges against Feigen and the other swimmers accused of damaging, Feigen would not have been able to take the plea bargain option. But the owner opted not do so.

Carregosa interviewed Feigen on Thursday night. The swimmer said he had initially lied to protect Ryan Lochte.

“He was very frightened,” Carregosa said. “He said he was very drunk and did not understand things properly. When he realized the day after [what had happened], he looked at the TV and he saw Ryan explaining on the TV.”

Feigen had been lying low in the Ipanema district, Carregosa said.

“He said he wanted to protect Ryan. He was scared of the repercussion,” Carregosa said. “He regretted everything that had happened.”

Carregosa described Lochte as the irresponsible ringleader of what police have described as acts of vandalism. At 32, Lochte was much older than the other three swimmers, who looked up to him, the officer said.

“For these three swimmers, Ryan is a reference, an icon,” he said. “If Ryan says jump of the bridge, they are going to jump. For a lack of maturity and his influence. They are very young.”

He said Feigen’s original testimony was much closer to the version of events that have now emerged, whereas Lochte’s was invented. “His version was pure fantasy,” Carregosa said.

The same misdemeanor has been offered against Lochte, who will also be required to either appear in Brazil or provide testimony in the United States.

“He will be judged in Brazil even if he does not appear. A lawyer will be nominated to represent his interests. Before we offer charges we will interview him, and we are seeing if he wants to provide testimony in the United States,” Carregosa said. “This could be with the FBI or another organ and they send to us.”