WASHINGTON (Reuters) - The House of Representatives averted a government shutdown on Thursday, narrowly passing a $1.1 trillion spending bill despite strenuous Democratic objections to controversial financial provisions.

Slideshow ( 4 images )

The vote followed a long day of drama and discord on Capitol Hill that highlighted fraying Democratic unity and featured an uneasy alliance between President Barack Obama and House Speaker John Boehner, enemies in past budget battles but on the same side this time in pushing for passage.

A vote on the measure was delayed for hours after Democrats revolted against provisions to roll back part of the Dodd-Frank financial reform law and allow more big money political donations, while conservative Republicans objected because the measure did not block funds for Obama’s immigration order.

Democrats said Republican leaders, flexing their new political muscle after big wins in the midterm elections that will give them control of both chambers of Congress next year, had gone too far in trying to roll back Dodd-Frank.

“We have enough votes to show them never to do this again,” Democratic House Leader Nancy Pelosi told members of her party, behind closed doors, according to a source in the room.

Some Democrats also demanded the removal of a provision that allows a massive increase in individual contributions to national political parties for federal elections, potentially up to $777,600 a year.

The debate pitted Obama against Pelosi, one of his most loyal allies in Congress, as Obama and his administration waged a last-ditch campaign to persuade Democrats to set aside their objections, arguing that if it failed, the party would get a worse spending deal next year under Republican control.

The effort to save the bill angered some Democrats, who complained that both Obama and JPMorgan Chase & Co chief executive Jamie Dimon were calling Democrats to support it.

“It is very strange, very strange that the two of them would be working for the support of this bill,” said Representative Maxine Waters, the top Democrat on the House Financial Services Committee.

In the 219-206 vote, 67 Republicans rejected the spending bill, largely because it failed to take action to stop Obama’s executive immigration order. But that was offset by 57 Democrats who voted in favor.

Shortly after passage, both the House and Senate passed a 48-hour extension to allow the Senate more time to consider the measure. Senate Democratic Leader Harry Reid said it would be debated on Friday.

The 1,603-page bill, negotiated by Republican and Democratic appropriators and leaders, drew Democrats’ ire when they discovered it would roll back the Dodd-Frank law due to go into effect next year by killing planned restrictions on derivatives trading by large banks, allowing them to continue trading swaps and futures in units that benefit from federal deposit insurance and Federal Reserve loans.

If passed by the Senate, the spending bill would fund all government agencies through September 2015, except for the Department of Homeland Security, which would get an extension only through Feb. 27. Republicans intend to deny funding to the agency to carry out Obama’s order allowing millions of undocumented immigrants to stay and work in the United States.

The measure keeps domestic spending largely flat, while providing billions of dollars in additional funds to fight Islamic State militants in Iraq and Syria and the Ebola outbreak in West Africa.