Philadelphia City Council has unanimously passed a hate crime law, protecting sexuality and gender identity for the first time.

The move comes two months after a brutal anti-gay assault in the city, which left a gay couple hospitalised with multiple injuries.

Police arrested three people in connection with the attack – but none of them could be charged with hate crimes, as neither Pennsylvania state law nor the city code actively recognised crimes based on sexual orientation.

The measure was approved unanimously by the City Council on Thursday, by a vote of 17-0, and is expected to be signed into law soon by Mayor Michael Nutter.

Councilwoman Blondell Reynolds Brown – who co-sponsored the bill – said: “My heart hurts for all people who are targeted because of who they are.

“If you think it is appropriate to hurt someone with hate in your heart, there will be a price to pay.”

A Pennsylvania-wide hate crimes bill was also been introduced, but has since stalled in the state congress.

Phillip Williams, 24, Kathyrn Knott, 24, and Kevin Harrigan, 26, who were all arrested over the anti-gay attack, will stand trial in December, and currently face charges of aggravated assault.