1 of 3
Jacquelyn Martin, Associated Press
Republican presidential candidate, Sen. Rand Paul, R-Ky. points while talking with visitors on Capitol Hill in Washington, Wednesday, Sept. 30, 2015. A temporary funding measure that would keep the government open past a midnight deadline easily sailed through the Senate on Wednesday and should shortly make its way through a badly divided House and on to President Barack Obama. Paul voted against the spending bill. The vote now goes to the House.

WASHINGTON — With just hours to a midnight deadline, a divided Congress headed toward approving a temporary spending bill late Wednesday to keep the government open.

Approval of such stopgap measures has often been routine, but debate this year exposed deep divisions between pragmatic Republicans such as House Speaker John Boehner and more junior lawmakers in the party's tea party wing less inclined to compromise. The tea partyers have demanded that the must-pass measure be used to punish Planned Parenthood, stripping it of federal money because of its practice of supplying tissue from aborted fetuses for scientific research.

Wednesday's legislation, on its way shortly to President Barack Obama for his signature, would finance the government through Dec. 11. That provides 10 weeks to negotiate a more wide-ranging budget deal that would carry past the 2016 presidential election, but there are no guarantees another showdown won't occur.

Boehner is resigning from Congress at the end of October, a decision he announced last week after informing Republicans he would not risk a government shutdown over Planned Parenthood.

A similar fight over implementing Obama's health care law sparked a 16-day shutdown two years ago that Boehner, Senate Majority Leader Mitch McConnell of Kentucky and other top Republicans did not want to repeat this year. McConnell is seeking to protect embattled incumbents in Democratic-leaning states such as Wisconsin and Pennsylvania, while some GOP conservatives are more apt to use the battle to appeal to the party's core voters on the right.

"Today was a win for the Washington cartel, and another setback for the American people," said Rep. Ted Cruz, R-Texas, who is using combat with Washington GOP leaders to help define his presidential campaign. "Republican leadership chose to abandon its constitutional power of the purse and to fund 100 percent of President Obama's failed agenda."

Support from Democrats helped power the measure through the Senate on a 78-20 vote, all of the opposition coming from conservative Republicans. House GOP leaders were also relying on Democrats to overcome opposition from tea partyers. The bill cleared a procedural hurdle in the House Wednesday afternoon that removed any doubt of passage later in the day.

Longtime lawmakers bemoaned the chronic dysfunction on Capitol Hill and the collapse of the annual appropriations process that is supposed to be wrapped up by now. Democrats demanding a new budget deal have blocked work in the Senate, while a fight over the Confederate flag halted work in the House with only six of the 12 annual spending bills having passed.

"It is to my great dismay that we are at this point again, requiring a temporary Band-Aid to buy us time to do our duty," said Rep. Hal Rogers, R-Ky., chairman of the Appropriations Committee, during House debate.

Tea party anger directed at Boehner over the Planned Parenthood issue helped prod the Ohio Republican's announcement to step down. His decision — and other House leadership races — have highlighted divisions between more pragmatic Republicans and hardline conservative wing that is increasingly dominant in Congress, especially in the rough-and-tumble House.

McConnell said Tuesday that he and Boehner spoke with Obama recently and that he expects budget negotiations to get underway soon. The turmoil in the House, where many conservatives want to block spending increases, is certain to complicate the talks, which are likely to focus on swapping near-term budget increases for the Pentagon and domestic programs for longer-term saving elsewhere in the budget.

Majority Leader Kevin McCarthy, R-Calif., the likely new House speaker, hasn't said whether he supports a deal.

At issue longer-term are efforts to increase the operating budgets for both the Pentagon and domestic agencies still operating under automatic curbs that would effectively freeze their spending at current levels. Republicans are leading the drive to boost defense while Obama is demanding equal relief for domestic programs.

The conversation among McConnell, Boehner and Obama took place in mid-September — before Boehner announced he was stepping down. Many of the conservative GOP lawmakers who helped bring Boehner down want to preserve stringent "caps" on the spending bills Congress passes every year. But Senate Republicans are generally more eager to rework the 2011 Budget Control Act that put them in place.

"We have to stop devastating sequester cuts from hitting our military and middle class, even the Republican leader agrees," said top Senate Democrat Harry Reid of Nevada. "Because a week or 10 days ago he said 'We are inevitably going to end up in negotiations that that will crack the Budget Control Act once again. I say 'hallelujah.'"

Eight of the 20 Republican senators who opposed the bill are up for re-election in states carried by Mitt Romney in 2012. Presidential aspirants Lindsey Graham of South Carolina and Marco Rubio of Florida skipped Wednesday's vote.

Republicans have long targeted Planned Parenthood, and the group's top official defended it in congressional testimony on Tuesday.

Republicans say that videos made by abortion foes show Planned Parenthood has broken federal laws including a ban on for-profit fetal tissue sales. The organization says it has acted legally and the videos were deceptively edited.