The Republican president was foiled in the Senate by his own party, which refused to grant him any of the $5bn (£4bn) he wants for a US-Mexico wall.
Two years on, Mr Trump has been unable to deliver on the central campaign pledge that electrified his rallies.
Congress faces a Friday midnight deadline for averting a partial shutdown of the federal government.
Failing to agree a longer-term spending plan, the Senate has only been able to approve a seven-week extension of funds.
The House of Representatives is expected to act on the legislation later this week.
President Trump told Republicans on Thursday afternoon he would not approve any deal that denies him wall funding, according to House Speaker Paul Ryan. He later described it as a "sacred obligation".
"I look forward to signing a bill that fulfils our fundamental duty to the American people," the president said on Thursday.
Mr Trump has repeatedly suggested in the past he will reject budget bills that include no money for his project, only to sign such measures once they reach his desk.
But fears of a government shutdown over the wall have set markets on edge. On Thursday the Dow fell by 2% - over 400 points - to a 14-month low, according to US media.
Members of the ultra-conservative House of Representatives Freedom Caucus were up in arms over the apparent retreat.
North Carolina congressman Mark Meadows, a key Trump supporter, said: "He [Trump] campaigned on the wall.
"It was the centre of his campaign. The American people's patience is running out."
He called on the president to veto the bill and renegotiate.