Investigators were paying particular attention to two members of the Turkish security detail who assaulted American Diplomatic Security officers assigned to protect the visiting delegation.

The men were briefly detained on the scene Tuesday and their guns confiscated. But when it was determined that they held diplomatic status, they were promptly released, according to a congressional aide briefed on the State Department’s investigation. By the time video of what had happened outside the ambassador’s residence shot across the internet Tuesday night, stoking outrage in the United States, the two men were on their way out of the country with Mr. Erdogan and the rest of his entourage.

The two men remain the subject of an active criminal investigation and will not be allowed to re-enter the United States, the aide said.

The congressional aide and others who shared details about the case spoke on the condition of anonymity to discuss details of the investigation. They declined to identify the two members of the Turkish security forces who were detained, but said their immunity was no longer in place.

The Turkish Embassy in Washington and officials in Turkey did not respond to requests for comment on Thursday. The embassy issued a statement on Wednesday contradicting much of the American officials account and laying blame for the episode on protesters who they said had incited the violence.

The exchange between Turkish security personnel and American diplomatic officers sheds light on just how far the Turks strayed outside the bounds of typical diplomatic behavior on Tuesday. It also highlights the challenge facing American officials who must navigate potential diplomatic immunity claims, not to mention political repercussions, even as they pledge to hold those involved accountable.