It is impossible to say how many gay men and women face persecution in Iraq. According to an Iraqi gay rights group, run by a former disc jockey in Baghdad named Ali Hili who now lives in London, 400 people have been killed in Iraq since 2003 for being gay.

Set against the many thousands of civilians and soldiers killed in the war, the number is small. But for Mr. Hili, and Mohammed and his friends, it is a painful barometer of just how far Iraq has shifted from its secular past.

For a brief, exhilarating time, from the mid-1980s until the early 1990s, they say, gay night life flourished in Iraq. Whereas neighboring Iran turned inward after its Islamic revolution in 1979, Baghdad allowed a measure of liberation after the end of the Iran-Iraq war.

Abu Nawas Boulevard, which hugs the Tigris River opposite what is now the Green Zone, became a promenade known for cruising. Discos opened in the city’s best hotels, the Ishtar Sheraton, the Palestine and Saddam Hussein’s prized Al-Rasheed Hotel, becoming magnets for gay men. Young men with rouged cheeks and glossed lips paraded the streets of Mansour, an affluent neighborhood in Baghdad.

“There were so many guys, from Kuwait, from Saudi Arabia, guys in the street with makeup,” said Mr. Hili, who left Iraq in 2000. “Up until 1991, there was sexual freedom. It was a revolutionary time.”

Then came the Persian Gulf war, and afterward Saddam Hussein put an end to nightclubs. Iraq staggered under the yoke of economic sanctions. While antigay laws were increasingly enforced, Mohammed and Mr. Hili said they still felt safe. Homosexuality seemed accepted, as long as it was practiced in private. And even when it was not tolerated, prison time could be evaded with a well-placed bribe.

The American invasion was expected to usher in better times.

“We thought that with the presence of Americans, life would become paradise, that Iraq would be Westernized,” Mohammed said. “But unfortunately the way things were before was so much better than where we are now.”