The U.S. Senate has approved a gay-inclusive hate crimes bill that President Obama has promised to sign.

Senators voted mostly along party lines 68 to 29 in favor of expanding hate crimes legislation to include sexual orientation and gender identity. The bill was tucked inside a must-pass defense bill, a move that rankled some Republicans.

House members approved the bill by an overwhelming majority on October 8.

In a speech to gay rights group the Human Rights Campaign (HRC), President Obama renewed his support for the measure.

“After more than a decade, this bill is set to pass and I will sign it into law,” he told a cheering audience.

HRC President Joe Solmonese wasted no time in praising the Senate.

“We're in the home stretch,” Solmonese said in a statement. “This critical piece of legislation is on its way to the president's desk for his signature. We look forward to President Obama signing it into law; our nation's first major piece of civil rights legislation for lesbian, gay, bisexual and transgender people. Too many in our community have been devastated by hate violence. We now can begin the important steps to erasing hate in our country.”

The bill is named for Matthew Shepard, a student at the University of Wyoming who was killed in 1998 by two men he met in a gay bar, and James Byrd Jr., a black man dragged to death behind a pickup tuck in Texas in 1998. Shepard was beaten and left to die shackled to a post along a rural road near Laramie. Judy Shepard devoted herself to passage of the bill named after her son.

Republicans said they objected to the process Democrats used to approve the legislation.

Arizona Senator John McCain called the inclusion of hate crimes in the defense bill an “abuse of the Senate process.”

In a statement, the senior senator from Tennessee, Lamar Alexander, said the opposed the legislation because it goes “too far.”

“I voted against the Defense bill because the Democratic majority attached something which has nothing to do with defense: an expansion of hate crime rules,” he said. “I support providing states and local authorities with federal assistance to enforce their own laws, but the changes in this legislation go too far.”

Social conservatives also opposed the measure. They argued hate crimes laws have a chilling effect on free speech and restrict religious liberties, despite the law's included First Amendment protections.