A judge in Brazil has ordered US swimmers Ryan Lochte and James Feigen to stay in the country after allegedly giving contradictory accounts of their robbery on Sunday.

Lochte said that he, Feigen and two other teammates were in a taxi travelling back to the Athletes' Village when they were pulled over by armed men carrying police badges.

They were allegedly ordered to get the ground, with the thieves taking their wallets and belongings.

Lochte is swimming's most decorated OIympian but has already returned to the US, ahead of the court ruling.

It was unclear whether Feigen had also left the country.