Washington — US congressional negotiators expressed optimism on Tuesday that legislators would pass a deal to avert another partial government shutdown, although it was still not clear if President Donald Trump would accept a deal funding border security but not a wall.

“I am cautiously optimistic that we will get this through,” Democrat Nita Lowey, who chairs the House Appropriations Committee, said on Tuesday after news of the tentative pact. “We cannot shut the government down.”

Asked if Trump had signalled support for the bipartisan deal, Lowey did not answer directly, but said it had the backing of US House speaker Nancy Pelosi and other Democrats, who control the lower chamber.

On Monday, Republican senator Richard Shelby said the congressional committee charged by Trump to address border security and government funding agreed in principle to pay for border-security programmes through September 30.

Legislators want to avoid repeating the recent 35-day government shutdown that shuttered key agencies, roiled financial markets and left hundreds of thousands of federal workers and contractors unpaid. They face a Saturday deadline to find a solution before funding expires again.

Trump’s demand for $5.7bn to fund a wall on the US border with Mexico triggered the shutdown in late December despite Republicans holding both the Senate and the House of Representatives.

By late January, the president backed down and agreed to reopen the about one-quarter of the government that had closed and called for a congressional committee to hammer out a plan. Any agreement now must pass a House controlled by Democrats, who took over the chamber in January.

Congressional aides said on Monday the latest deal did not contain $5.7bn for Trump’s long-promised wall, a cornerstone of his presidential campaign that he had said would be paid for by Mexico and not by US taxpayers.

A final agreement is expected by late Wednesday.

Congressional sources said it would include $1.37bn for new fencing along 90km of the southern border but only with currently used designs, such as steel bollard fencing. It would also fund immigrant detention beds.

Still, it was unclear if Trump would sign the measure into law, given its backing from congressional Republicans, or side with vocal conservative commentators who have the president’s ear such as Sean Hannity of Fox News, who late on Monday called it a “garbage compromise”. Democrats oppose the wall, but support border-security efforts.

Trump has threatened to declare a national emergency if Congress does not give him wall money.

“Just so you know – we’re building the wall anyway,” Trump said at a rally in the border city of El Paso, Texas, shortly after the deal was reached. “Maybe progress has been made – maybe not.”

Beto O’Rourke, the former Texas Democratic congressman considering a 2020 White House run, accused Trump at a rally of stoking false fear about immigrants and telling lies about O’Rourke’s home town of El Paso.

Without new funds, federal agencies would again have to suspend some activities this weekend, ranging from maintenance of national parks to the publishing of important economic data.