US swimmer Ryan Lochte escaped with his life in armed robbery in Rio de Janeiro Reuters

US gold-medallist swimmer Ryan Lochte recounted the heart-stopping moment when a Rio robber posing as a police officer held a cocked gun to his head and stole money from him and three other teammates.

Lochte and fellow US swimmers Jack Conger, Gunnar Bentz and Jimmy Feigen had left a party at Club France, a French hospitality house at the Games in a taxi early Sunday morning (14 August) to head back to their Olympic Village housing when the car was stopped by the robbers.

"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, 32, told NBC.

"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 cell phone, he left my credentials."

None of the swimmers were injured. Police are investigating.

The International Olympic Committee (IOC) originally denied press reports that the men had been robbed by gunmen at the Club France party. IOC spokesman Mark Adams told the Associated Press (AP) that the story was "absolutely not true."

Lochte swam in two events at the Rio Games, winning gold in the 4x200m freestyle relay. He is the second most decorated male swimmer in Olympic history with 12 medals. Only US teammate Michael Phelps has won more with 22 gold medals.

Lochte thanked his family, friends and fans for support after the crime in an Instagram post. He wrote: "What is most important is that we are safe and unharmed."

The Rio de Janeiro Olympics have been wracked by crime with thefts reported by athletes and staff and violence. The night of the opening ceremony, Olympic security chief Felipe Seixas was accosted by four men with knives near the Maracana Stadium. A policeman shot dead one of the would-be robbers and the others escaped.

Two coaches for Australia's rowing team were also attacked and robbed in the Ipanema neighbourhood.