Congress managed to prevent much of the Department of Homeland Security (DHS) from shutting down on Friday -- but there's always next week.
After a day marked by high drama and surprising setbacks, lawmakers in both chambers narrowly avoided a shutdown late Friday evening by passing a bill extending DHS funding for one week. The temporary resolution came just hours before the department's coffers ran dry at midnight. President Obama signed the bill shortly before the deadline.
After several longer-term funding proposals faltered, the Senate attached a one-week DHS funding extension to a previously-passed House bill on Friday evening and sent the proposal across the Capitol to the lower chamber. The procedural maneuver was required because spending bills must originate in the House.
Republican leaders in the House put the measure on the floor under a process known as "suspension," which requires a two-thirds majority for passage. A coalition of Republicans and Democrats came together to push the measure over the finish line, with 357 lawmakers voting in favor of the bill and 60 voting against it.
The bill's passage was virtually assured after House Minority Leader Nancy Pelosi, D-California, signaled to her members that they should support the one-week extension in the hope of securing a longer-term solution next week.
"We are asking you once again to help advance passage of the Senate passed, long-term funding of DHS by voting in favor of a 7-day patch that will be on suspension in the House tonight," Pelosi told her caucus in a letter on Friday. "Your vote tonight will assure that we will vote for full funding next week."
Lawmakers in both chambers were unable to agree to a longer extension of funding due to disagreements over the President Obama's proposal to shelter millions of undocumented immigrants in the U.S. from the threat of deportation. Conservative Republicans in both the House and Senate wanted to insert language into a DHS funding bill prohibiting the president from moving forward with his proposed actions, but Democrats insisted on a "clean" bill devoid of any immigration riders.
Republicans chose the DHS funding fight to take a stand on immigration because the department is responsible for securing the border and issuing the work permits that would allow undocumented immigrants to remain in the U.S. While the rest of the government was funded through September in a spending deal reached last December, DHS funding was scheduled to expire in February so Republicans could take another crack at the president's immigration policies after assuming full control of Congress in January.
Earlier on Friday, the Senate approved a bill that extended DHS funding through September but did not tie the president's hands on immigration. The measure passed by a 68 to 31 margin, with enough Republicans joining the upper chamber's Democrats to push it over the top.
House GOP leaders, aware that such a proposal could not clear their chamber, rallied their members to support a three-week funding extension to push the immigration fight into next month.
They argued that a short-term funding extension would not free the president to act on immigration, because the implementation of Mr. Obama's plan was halted this week by a federal judge in Texas. The judge ruled that 26 states suing the federal government over the proposal had the necessary standing to pursue their lawsuit. The administration has appealed the ruling.
The three-week funding extension failed to clear the House, though, going down by a margin of 203 to 224. Fifty-two Republicans defected from that plan despite their leaders' support for it, and only 12 Democrats crossed the aisle to support it.
The House also voted earlier Friday to go to conference with the Senate's bill, angling for an opportunity to insert immigration language into the legislation during negotiations. But Senate Democrats, wary of any alteration to the Senate's "clean" funding bill, resisted conferring with the House.
After the three-week extension failed to clear the House, activity began on the one-week extension that was ultimately passed Friday evening to keep DHS open through March 6.
That outcome punts the fight into next week, ensuring another high-stakes round of negotiations over funding a department with a wide array of national security and law enforcement responsibilities.
It's not clear what lawmakers will do to resolve a fight next week that they were unable to resolve this week. If the Senate could be persuaded to go to conference with the House on a bill funding DHS through September (which is far from certain), both chambers would then have to determine whether whatever emerges from that conference can pass. But if the product of a conference committee prohibits the president from acting on immigration, Senate Democrats are likely to block it from passing their chamber. And if it contains no immigration restrictions, there's no indication conservative Republicans in either chamber are prepared to soften their opposition.
The administration hasn't exactly welcomed a short-term resolution, urging lawmakers to fund the department through the end of the fiscal year in September. Homeland Security Secretary Jeh Johnson warned Congress in a letter Thursday night that a short-term funding extension would have "many of the same negative impacts" as a shutdown.
"A short-term continuing resolution exacerbates the uncertainty for my workforce and puts us back in the same position, on the brink of a shutdown just days from now," he wrote.
House Democratic leaders have said they are already consulting with their GOP colleagues on the road ahead. Pelosi said Friday that she expects the House to vote on the Senate's "clean" bill funding DHS through September in the next five to seven days, but House Republican leaders haven't indicated what they'll do next. A spokesman for House Speaker John Boehner, R-Ohio, says "no such deal or agreement" concerning the Senate bill was made, and that Pelosi may be speculating on possible next steps based on conversations with the speaker or Senate leaders.
If lawmakers are unable to broker a solution by next Friday, and DHS funding lapses, none of the department's 200,000-plus employees would receive a paycheck until funding is restored. Many of them would still remain on the job, though -- 85 percent of DHS staffers are considered "essential" federal employees because their jobs affect national security.
CBS News' Alicia Amling contributed to this report.
© 2015 CBS Interactive Inc. All Rights Reserved.