-- Lawmakers narrowly avoided a partial shutdown of the Department of Homeland Security and furloughing thousands of employees Friday when they reached a last-minute deal to approve a one-week funding measure for the department.
Just two hours before the midnight deadline, the House voted 357 to 60 to fund the department for one week. The Senate passed the measure earlier in the evening by a voice vote.
President Obama signed it into law late Friday.
Less than one hour before the vote, House Minority Leader Nancy Pelosi sent her Democratic colleagues a letter urging them to advance the seven-day measure.
That last-minute strategy proposed by House Republicans failed with a vote of 203 to 224. Fifty-two Republicans opposed the measure while 12 Democrats supported it.
President Obama held a meeting in the Oval Office late Friday with DHS Secretary Jeh Johnson and OMB Director Shaun Donovan to discuss the potential shutdown, White House Press Secretary Josh Earnest said. The president personally phoned House Minority Leader Nancy Pelosi and Senate Minority Leader Harry Reid to receive an update on the situation.
The evening’s drama rounds out months of fighting between Democrats and Republicans over the funding. Republicans have wanted to link any funding for the department to immigration. Earlier this month, the House passed a bill that would fund the department through the end of the fiscal year while also blocking President Obama’s recent executive actions on immigration.
But Democrats opposed that plan, instead pushing for a clean funding bill. Earlier in the day, the Senate passed a clean funding measure with a vote of 68 to 31 to fund the Department of Homeland Security through Sept. 30.
ABC News' John Parkinson contributed to this report.