WASHINGTON (CBSNewYork/AP) — Congress is sending President Barack Obama a bill to fund the Department of Homeland Security through the end of the budget year, without overturning the president’s immigration policies.

The House on Tuesday voted 257-167 for the measure that Obama is expected to sign. Without action, funding for the department would have expired Friday at midnight.

The outcome was a victory for Obama and Democrats, and a defeat for the GOP strategy of trying to overturn Obama’s executive actions on immigration by linking them to funding for Homeland.

Republicans were unable to overcome united opposition from Senate Democrats to their strategy. They also suffered embarrassing internal divisions that left the country within hours of a partial agency shutdown last week.

In previous versions of the long-term bill, Republicans attached amendments that would have prevented federal funds from being spent to enforce Obama’s executive order to protect some 4 million undocumented immigrants from deportation.

In New York, Mayor Bill de Blasio and members of Congress expressed outrage Monday over the impasse.

De Blasio described Republicans’ tinkering with Homeland Security funding as inappropriate, unfair and dangerous.

“We never thought we’d have to protect ourselves without the partnership of the federal government and if this situation is not reversed that’s exactly what we’ll be dealing with,” the mayor said.

(TM and © Copyright 2015 CBS Radio Inc. and its relevant subsidiaries. CBS RADIO and EYE Logo TM and Copyright 2015 CBS Broadcasting Inc. Used under license. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.)