Congress approved a stopgap measure late Friday to keep the Department of Homeland Security funded for another week -- averting a crisis just before money was set to run out at midnight, but setting up a new standoff as conservatives press their fight over President Obama's immigration plan.
The House passed the measure, 357-60, and the Senate approved it on a voice vote without objection just hours before funding was to expire.
Shortly before the midnight deadline, Obama signed the temporary measure into law.
The agreement to provide just one week of funding for the department emerged as a last-ditch compromise. The House rejected a three-week stopgap bill earlier Friday, a major defeat for House Speaker John A. Boehner (R-Ohio) that demonstrated the continued inability of Republican leaders to manage their majority and threatened the massive agency's ability to pay its workers and fund its programs.
House Republicans, who were trying to use the funding bill as leverage in their fight against Obama's plan to shield millions of immigrants from deportation, also had no interest in a full-year funding bill approved in the Senate.
As evening wore on at the Capitol and most senators had left, lawmakers in the House hunkered down for a long night with no end-game in sight.
Obama convened an Oval Office meeting with Homeland Security Secretary Jeh Johnson and other senior officials, and called Democratic congressional leaders for "an update on efforts to ensure that the Department of Homeland Security does not shut down," the White House said.
Senate Majority Leader Mitch McConnell (R-Ky.) stepped forward and swiftly offered the compromise as a way to prevent a funding lapse that most lawmakers feared would be politically damaging. It passed in a matter of minutes in an almost empty Senate. House leaders quickly called the vote in their chamber.
Boehner had been reluctant to buck his conservative flank on the immigration issue, but without their support, he had little choice but to reach across the aisle for Democratic votes to pass the one-week funding bill. House Minority Leader Nancy Pelosi (D-San Francisco) had urged her colleagues to oppose Boehner's earlier plan, but she called on them to help pass the emergency measure.
"We certainly want to protect the American people every minute of every day, 24/7 – that includes today," said Pelosi. "And we believe that in the next seven days – hopefully five – that we will have a bill that takes us to the end of the fiscal year."
The department's authority to spend money was set to expire at midnight Friday, although the impact on its operations would probably have been muted until Monday at the earliest.
The more lasting damage from the vote rejecting longer-term funding may be to Boehner, McConnell and the Republicans' effort to showcase their congressional majority as evidence of the party's ability to govern.
Immediately after winning control of both houses in November's midterm election, Boehner and McConnell said the new Republican Congress would demonstrate to voters that they could trust the party, not only with Congress but with the presidency. In both houses, Republicans talked of an aggressive legislative agenda to set out their priorities.
So far, however, those plans have taken longer to come to fruition, much to the delight of Democrats.
"The Republican Congress has shown that it simply cannot govern," said Senate Minority Leader Harry Reid (D-Nev.) "How many more times will Republicans send us hurtling towards a completely avoidable cliff?"
Friday's initial vote brought a chaotic scene to the House floor, where 52 Republicans rebuffed a last-minute effort by their leadership to salvage Boehner's three-week stopgap measure.
House leaders kept the roll call open for almost an hour, long after the official voting time had expired, as they sought unsuccessfully to persuade members to change their votes. Nearly all House Democrats voted no because they preferred a Senate-passed bill that would have provided funds to the department for the rest of the fiscal year.
The bill's defeat, 203 to 224, shocked senior lawmakers and left the next step unclear.
"It seemed like a no-brainer," said Rep. Chuck Fleischmann (R-Tenn.), who voted for the package.
House Majority Leader Kevin McCarthy (R-Bakersfield) warned members they might need to work through the weekend to try to resolve the problem.
If Congress does not pass a funding bill, some of Homeland Security's more than 200,000 employees would be furloughed, but most would be required to work without pay as they guard the nation's borders and ports and run programs such as immigration, customs and airport security.
In past government shutdowns, federal employees have received retroactive pay, but that is not guaranteed. Johnson has warned that working without a paycheck would cause hardship for many in his department and that the uncertainty over funding was disrupting its operations.
The House and Senate have spent most of this month tied up on the standoff over Homeland Security funds.
Conservatives have tried to use the funding bill as leverage in an effort to roll back Obama's executive action on immigration. Many conservatives oppose the plan as a matter of policy and see it as an overreach of the president's executive authority.
For a time, earlier in the day, Republican leaders thought they had found a way forward. In the morning, the Senate passed its bill, 68 to 31, to fund Homeland Security for the remainder of the fiscal year. Conservative Republicans made up the opposition.
The legislative maneuvering left conservatives upset that they had been unable to stop Obama's immigration plan and more pragmatic Republicans weary of dragging out the fight over Homeland Security funds at continued risk.