President Donald Trump agreed to re-open the federal government for about three weeks without any guarantee Congress would provide money for his proposed border wall, his top campaign promise, capitulating to House Speaker Nancy Pelosi.

Trump agreed Friday to a deal hastily negotiated by lawmakers after the 35-day shutdown, the longest in modern U.S. history, began to seriously impact air travel. Earlier in the day, LaGuardia Airport in New York was briefly closed due to a shortage of air traffic controllers, exacerbating flight delays across the country.

Under terms of the agreement, Trump will sign a short-term spending bill through Feb. 15 and Congress will immediately begin negotiating border security legislation.

Senate Majority Leader Mitch McConnell said the chamber will vote “immediately” on the deal. House passage also is required and could happen soon afterward unless a member objects. In that case, House members would have to return to Washington for a floor vote.

The president threatened that if a final deal doesn’t include money for a wall, he would either shut down the government again or declare a national emergency that he says would allow him to begin construction without congressional approval.

“We really have no choice but to build a powerful wall or steel barrier,” Trump told reporters in the White House Rose Garden. “If we don’t get a fair deal from Congress the government will either shut down on Feb. 15 again or I will use the powers afforded to me under the laws and the Constitution of the United States to address this emergency.”

Pelosi told reporters that a House-Senate conference committee “will draw out everyone’s view of what is the best way to protect our borders.” The Senate’s top Democrat, Chuck Schumer of New York, said lawmakers will “roll up our sleeves” to work our a deal that’s “acceptable to both sides.”

Trump said he will make sure that some 800,000 federal workers who haven’t been paid since the shutdown began Dec. 22 will receive back wages quickly. Many of those workers missed their second paycheck on Friday.

Negotiations in the Senate restarted Thursday after the chamber rejected rival plans from Trump and Democrats to fund the government. Trump had refused to end the shutdown until he received US$5.7 billion for a border wall, and Democrats had refused to negotiate with him on wall funding as long as the shutdown continued.

The temporary funding deal came together Thursday in a meeting between Schumer and McConnell, according to a Democratic aide. McConnell said there would need to be a down payment on the wall -- terms that Schumer rejected.

Schumer then suggested a short-term funding measure to reopen government followed by a House-Senate conference committee on a funding bill that would focus on border security, according to the aide.

McConnell took the proposal to the White House, the aide said. Schumer and McConnell spoke several times by phone on Friday to discuss how to pass the temporary funding measure, and Schumer spoke with Pelosi, who was on the same page, according to the aide.

Some of Trump’s most conservative supporters turned on him after he announced the deal, including author Ann Coulter, who called him a “wimp” in a tweet. Breitbart News published a headline noting the government would re-open but there would be “no wall.”