A Queens man was formally charged this week in an attack on a same-sex couple outside a Brooklyn gay bar and faces up to 15 years in prison if convicted.

Brandon McNamara, 25, is charged with assault as a hate crime, menacing as a hate crime, and aggravated harassment in the attack, which took place outside a bar in Brooklyn's Williamsburg neighborhood in late September, according to a statement released by Brooklyn District Attorney Eric Gonzalez.

McNamara is accused of knocking both men unconscious after using an antigay slur. The attack sent both to the hospital. One had a broken finger while the other suffered a dislocated and fractured left shoulder.

“This defendant allegedly assaulted an innocent couple simply because he perceived they were gay,” Gonzalez said in the statement. “Crimes that target individuals because of their sexual orientation, race, ethnicity, religion, gender, or other identity are a threat to everything we stand for here in Brooklyn. The defendant has now been indicted and we intend to seek justice for the victims.”

McNamara turned himself in three days after the attack; a witness had taken a photo of him, which was released to the media. McNamara has been ordered to return to court January 16. He can be sentenced to up to 15 years in prison if convicted of the most serious charge.