But 131 Republicans in the House of Representative voted against what they called "thought crimes" legislation that they felt was inappropriately attached to a defense spending bill.
"The inclusion of 'thought crimes' legislation in what is otherwise a bipartisan bill for troop funding is an absolute disgrace," said Rep. Tom Price of Georgia, head of the GOP conservative caucus.
The legislation, if passed by the Senate and then signed by President Obama, would bring major changes to the law enacted in the days after Martin Luther King Jr.'s assassination in 1968.
"No American should ever have to suffer persecution or violence because of who they are, how they look or what they believe," said House Speaker Nancy Pelosi, D-Calif., noting that hate crimes legislation has been on her agenda since she first entered Congress more than two decades ago.
She added that it's been 11 years since the gay Wyoming college student Matthew Shepard, whose name was attached to the legislation, was murdered.
Civil rights groups and their Democratic allies have come close to expanding the hate crimes bill several times in the past decade, but have always fallen short because of lack of House-Senate coordination or opposition from former President George W. Bush.
But this time it appears they may succeed. The bill was attached to a must-pass $680 billion defense policy bill that the Senate could approve as early as next week. President Barack Obama, unlike his predecessor, has promised to sign it into law. The late Edward Kennedy, D-Mass., was a longtime advocate of the hate crimes legislation.
The House vote on the defense bill was 281-146. Unlike usual defense bill votes, most of those in opposition, 131 out of the 146 were Republicans objecting strenuously to inclusion of what they referred to as "thought crimes" legislation in a defense bill.
GOP opponents were not assuaged by late changes in the bill to strengthen protections for religious speech and association, as critics argued that pastors expressing beliefs about homosexuality could be prosecuted if their sermons were connected to later acts of violence against gays.
Supporters countered that prosecution could occur only when bodily injury is involved, and no minister or protester could be targeted for expressing opposition to homosexuality.
The bill also creates a new federal crime to penalize attacks against U.S. service members on account of their sexual orientation.
Hate crimes legislation enacted after King's assassination defined hate crimes as those carried out on the basis of race, color, religion or national origin. It also limits the scope of activities that would trigger federal involvement.
The proposed expansion would include crimes based on gender, sexual orientation, gender identity or disability. It eases restrictions on federally protected activities.
"The day is within sight when lesbian, gay, bisexual and transgender people will benefit from updating our nation's hate crimes laws and giving local law enforcement the tools they need to combat hate violence," said Joe Solmonese, president of the Human Rights Campaign, the nation's largest gay rights group.
Some 45 states have hate crimes statutes, and the bill would not change the current situation where investigations and prosecutions are carried out by state and local officials.
But it would provide federal grants to help with the prosecuting of hate crimes and funds programs to combat hate crimes committed by juveniles.