BAGHDAD — As a former interpreter for the American military, and as a gay man, Hassan says he is a focus of frequent discrimination by his fellow Iraqis.

That is why Hassan, who asked to be identified only by his middle name because he fears for his safety, does not see any future in his own country, where he is shunned for his sexuality and viewed as a traitor.

His last and best hope, he said, is a visa to the United States.

But that chance is now fading for Hassan and many others who worked for the American military. As they face increased violence here, they find themselves trapped in a glacially paced visa program set up for Iraqis that will expire at the end of the month unless new legislation is enacted to save it.

“The United States is my last hope for salvation,” said Hassan, whose case is being assisted by a New York-based organization, the Iraqi Refugee Assistance Project at the Urban Justice Center. “It’s a place where I can be who I am, where people will accept me for who I am.”