The House passed a bill Thursday intended to ease the burden on homeowners struggling to pay their mortgages.

The so-called "cram down" bill passed by a 234-191 margin. The final tally was not entirely party-line as 24 Democrats voted against the bill and seven Republicans supported the measure.

The legislation, which now heads to the U.S. Senate for consideration, empowers federal judges to modify the mortgages for borrowers who file for bankruptcy, including lengthening loan terms, reducing interest rates and cutting principal payments. 

The bill is officially dubbed the "Helping Families Save Their Home Act," but is known as the "cram down" bill because it enables judges to reduce or cram down the size of the mortgage.

The legislation ran into some trouble last week when a group of moderate Democrats raised concerns that the legislation would make bankruptcy too attractive to homeowners facing foreclosure. But after passing an amendment today supported by the group, the bill now requires that borrowers and lenders make a good faith effort to modify a mortgage before homeowners make the leap to bankruptcy court.

"This is something that will help all Americans by making sure that the bankruptcy process through Chapter 13 is available to those that need it, but at the same time it is the option of last resort," said Rep. Ellen Tauscher, D-Calif., who heads the New Democrat Coalition, the moderate group of Democrats that sought to alter the bill.

Republicans, who argue that the cram down bill rewards some irresponsible borrowers and lenders, failed in their last-ditch effort to kill the legislation this afternoon by a mainly party-line vote. Their "motion to recommit" failed by a 182 - 242 vote.

The GOP attempt to send the bill back to committee called for limiting the scope of the legislation to ensure "unscrupulous and irresponsible actors" would not receive government funds.

During final floor debate Thursday afternoon, Rep. Barney Frank, D-Mass., accused Republicans of following the lead of conservative radio talk show host Rush Limbaugh and his call to ensure President Obama fails. Frank warned that Republicans would be "taking a lot of innocent people hostage" if they defeated the bill.

Meanwhile, Republicans argued that they are only trying to defend American taxpayers.

"When it comes to housing, today is just another example of why taxpayers are fed up with the way Washington works. The American people are sick and tired of Washington forcing taxpayers to pay for the actions of those who have been irresponsible," Minority Leader John Boehner said.