The Local Law Enforcement Hate Crimes Prevention Act, also known as the Matthew Shepard Act, has been passed by the US House of Representatives.

The bill expands federal hate crime laws to include crimes where the victims were targeted on the basis of sexual orientation, gender identity, gender, and disability.

It means the federal government could step in to prosecute in states that request it or in those who choose not to prosecute.

The Senate version of the bill is to be introduced soon by Senator Edward Kennedy, a Massachusetts Democrat.

President Obama has indicated that if the bill comes to his desk he will sign it, releasing a statement prior to yesterday’s vote.

He said: “I urge members on both sides of the aisle to act on this important civil rights issue by passing this legislation to protect all of our citizens from violent acts of intolerance.”

He added it would “enhance civil rights protections, while also protecting our freedom of speech and association.”

The bill, which passed 249-175, has been dubbed the Matthew Shepard bill after the gay teenager who was brutally murdered in 1998.

A North Carolina congresswoman was forced to apologise this week after she called the murder a “hoax” to justify passing the bill, saying Mr Shepard had died in a robbery.

Republican representative Virginia Foxx later said she had used “a poor choice of words,” adding that his killers deserved their punishment of life imprisonment terms.

Opponents have argued that the bill is divisive and could cause religious leaders to be prosecuted.

Representative Lamar Smith, a Texas republican, said the bill “divides America” by protecting special groups.

“We should focus on the opposite, uniting America,” he said. “The bill is probably unconstitutional and will be struck down.”