The Republican-led US House of Representatives has backed down over a dispute that could have led to a partial shutdown of the agency overseeing US borders - handing a major victory to president Barack Obama.
Congress has sent Mr Obama a bill to fund the Homeland Security Department through the end of the budget year, without overturning the president's immigration policies.
Republican leaders did not give in to conservatives' demands that the bill should also roll back Mr Obama's directives, sparing millions of immigrants from deportation.
Democrats had insisted on legislation to fund the department, which shares responsibility for anti-terrorism operations, without any conditions.
The House voted 257-167 in favour of the 40 billion dollar (£25 billion) spending bill, which Mr Obama is expected to sign promptly.
All 182 Democrats present voted for the bill, while it received only 75 Republican "yes" votes.
The Republicans' retreat underscored the limits on their power despite the party's widespread gains in November's elections.
House speaker John Boehner outlined the dwindling options for his deeply divided Republican caucus after the Senate left the House with little choice. Mr Boehner pointed out that the issue of the president's executive actions on immigration last autumn is now in the hands of the courts.
Mr Boehner said: "I am as outraged and frustrated as you at the lawless and unconstitutional actions of this president.
"I believe this decision - considering where we are - is the right one for this team, and the right one for this country."
House Republicans said that after months spent railing against Mr Obama's executive actions, which most Republicans view as an unconstitutional overreach, they had no more moves to make.
A federal court ruling has temporarily blocked the administration from implementing the new immigration rules. The administration has appealed the decision, and the ultimate result of the legal challenge is unknown.
The Republican leadership's decision angered several conservatives, while some Republicans welcomed Mr Boehner's move.
Representative Mike Simpson said he, too, opposes Mr Obama's executive actions on immigration. Yet he also said the "security of the homeland is one of our highest priorities," and added that Congress could continue to oppose the president without forcing a partial agency shutdown that was on the cards for Friday.
Whatever the final result of the struggle, controversy over the legislation has produced partisan gridlock in the first several weeks of the new Congress.
For the first time in Mr Obama's presidency, Republicans have full control of Congress after capturing the Senate in November. They also won more seats in the House than at any time in 70 years.
Democratic unity blocked passage in the Senate of House-passed legislation with the immigration provisions. By late last week, a split in House Republican ranks brought the department to the brink of a partial shutdown. That was averted when Congress approved a one-week funding bill that Mr Obama signed into law only moments before a midnight Friday deadline.
In a statement, Mr Obama praised Homeland Security employees as "law enforcement professionals and brave patriots who do a remarkable job, and deserve our gratitude and respect. Today, after far too long, Congress finally voted to fully fund their mission."