WASHINGTON — Bordering on dysfunction, Congress passed a one-week bill late Friday night to avert a partial shutdown of the Homeland Security Department, as leaders in both political parties quelled a revolt by House conservatives furious that the measure left President Barack Obama's immigration policy intact.
The final vote of a long day and night was a bipartisan 357-60 in the House, a little more than an hour after the Senate cleared the measure without so much as a roll call.
That sent the legislation to the White House for Obama's signature, and capped a day of bruising political battles and rhetoric to match.
"You have made a mess," House Democratic Leader Nancy Pelosi said at one point to Republicans, as recriminations filled the House chamber and the midnight deadline neared for a partial shutdown of an agency with major anti-terrorism responsibilities.
Even some Republicans readily agreed.
"There are terrorist attacks all over world and we're talking about closing down Homeland Security. This is like living in world of crazy people," tweeted Rep. Peter King of New York, a former chairman of the HomelandSecurity Committee.
Hours after conservatives joined with Democrats to vote down a three-week funding measure, 224-203, the Senate presented a one-week alternative to keep open the agency, which has responsibility for border control as well as anti-terrorist measures.
That amounted to a take-it-or-leave it offer less than three hours before the deadline.
Some Republican opponents — members of a "Freedom Caucus" — sat together in the chamber as the vote total mounted in the legislation's favor.
This time, Pelosi urged her rank-and-file to support the short-term measure, saying it would lead to passage next week of a bill to fund the agency through the Sept. 30 end of the budget year without immigration add-ons. Aides to Speaker John Boehner promptly said there had been no such promise made.
Taken together, the day's roller-coaster events at the Capitol underscored the difficulty Republicans have had so far this year in translating last fall's election gains into legislative accomplishment — a step its own leaders say is necessary to establish the party's credentials as a responsible, governing party. Republicans gained control of the Senate in November's balloting, and emerged with their largest House majority in more than 70 years.
Further demonstrating GOP woes, House GOP leaders abruptly called off a vote on a major education bill that had attracted significant opposition from conservatives as well as Democrats and the White House. Aides attributed that decision to the need to work separately on rounding up enough votes to pass the funding measure for Homeland Security.
For their part, tea party conservatives in the House unflinchingly defended their actions.
"It does not make any difference whether the funding is for three weeks, three months or a full fiscal year. If it's illegal, it's illegal," said Rep. Mo Brooks, R-Ala.
He referred to a pair of immigration directives issued by Obama. The first, in 2012, lifted the threat of deportation from many immigrants brought to the country illegally as youngsters. Another order last fall applied to millions more who are in the United States unlawfully.
The unexpected House defeat of a three-week spending bill was accomplished by 52 conservatives upset by the deletion of the immigration provisions, alongside solid opposition from Democrats who wanted the agency funded through Sept. 30.
That set an unpredictable chain of events in motion. Homeland Security officials circulated a lengthy contingency plan indicating that about 30,000 employees could expect to be furloughed without passage of funding legislation.
Then the White House announced Obama had spoken with Pelosi and Senate Democratic Leader Harry Reid. Moments later, Majority Leader Mitch McConnell of Kentucky strode onto the Senate floor and swiftly gained approval for the seven-day measure.
The Senate had waited all day to play its part in the funding of the agency.
Earlier, a largely symbolic attempt to advance legislation that would repeal Obama's immigration directive of last fall failed on a vote of 57-42, three short of the 60 required.
That separate proposal was "commonsense legislation that would protect our democracy from the egregious example of executive overreach we saw in November," said McConnell, who successfully led his rank and file in recent days to a decision to pass Homeland Security legislation without immigration-related provisions.
Some House Republicans said the entire strategy of passing a short-term measure and seeking negotiations on a longer-term bill that included changes in Obama's immigration policy was flawed. They noted that Senate Democrats had demonstrated their ability to block any challenges to Obama's immigration policies, and that the president had vowed to veto them in any event.
"Some folks just have a harder time facing political reality than others," said Rep. Charlie Dent, R-Pa., speaking of other Republicans.
___
Associated Press writers Charles Babington, Andrew Taylor, Matthew Daly and Laurie Kellman contributed to this report.