RIO DE JANEIRO — Soon after the first news media reports surfaced Sunday morning of an armed assault on four American swimmers, the athletes were interviewed at the United States Olympic team’s hospitality house by State Department officials, national swim team officials and Olympic officials. They all agreed that the swimmers should avoid further attention and that the United States Olympic Committee would soon put out a statement.

But Ryan Lochte, a 12-time medal winner, left the hospitality house and walked across the street to Ipanema Beach, where he gave a lurid interview to NBC, describing a gun-to-head holdup by men identifying themselves as police officers.

Mr. Lochte’s account touched off a dispute that quickly transcended sports, emerging as a point of tension between the United States and Brazil as the authorities in Rio de Janeiro faced scrutiny over their security preparations for the Olympics in a city on edge over a crime wave and gun battles between drug gangs and the police.

On Thursday, Mr. Lochte’s account came under siege by the Brazilian police in an internationally televised news conference. They said he had fabricated his description of the episode, damaging Rio’s image at its moment on the global stage.