Lochte, Gunnar Bentz, Jack Conger and Jimmy Feigen were stopped by people posing as armed police, the US Olympic Committee (USOC) said in a statement.
The robbers demanded money and other personal belongings.
After reports emerged of the incident, the USOC initially denied that Lochte had been robbed.
"All four athletes are safe and co-operating with authorities," the USOC's statement said.
The group had been attending a party at the French Olympic team's hospitality house when their taxi was stopped on the way back to the athletes' village.