A government shutdown in the US looks likely to have been avoided after the House of Representatives approved a $1.3 trillion dollar spending bill in a move that will significantly boost defense and non-military funding through September 30.
The bill now goes to the Senate which is expected to vote before current government funding expires at midnight on Friday.
Coupled with recently enacted tax cuts, the bill is projected to lead to budget deficits of more than $800 billion for this year. Conservatives had balked at the deficit spending and warned it could create problems for Republicans running for re-election in November.
Passage of the spending bill will end several months of bickering between Republicans and Democrats which led to two short government shutdowns earlier this year.
It also delivered a setback to Trump, whose proposals for severe cuts to the Environmental Protection Agency, State Department and other federal agencies were scaled back.
The president also failed to receive all the funding he wanted to build the southern wall on the US border with Mexico.
But this did not stop him going on social media to claim success.
Democrats have argued the added funds will help build or restore a range of other barriers, including existing fencing, and would not pay for a concrete edifice that Trump originally said would be financed by Mexico - a claim the Mexican government has denounced.
Trump at one point wanted $25 billion included in the bill to fully fund construction of his proposed U.S.-Mexico border wall, but negotiations with Democrats on that fell apart early this week, according to congressional aides.
Earlier on Wednesday, the White House signaled that Trump would sign the legislation if Congress sends it to him.