Donald Trump is pressing Democratic leaders to support his demand for billions of dollars to build a wall along the Mexico border, threatening to have the military build it “if Democrats do not give us the votes to secure our Country”.

The president tweeted the threat hours before Senate Democratic leader Chuck Schumer and House Democratic leader Nancy Pelosi were scheduled to meet him at the White House in an effort to avert a possible partial government shutdown on December 21, when funding for some agencies is scheduled to expire.

In a series of tweets, Mr Trump said immigration and border patrol agents and thousands of active-duty service members he sent to the border had done a “fantastic” job, but “a great wall” would be “far easier”.

He said he looked forward to meeting with Mr Schumer and Ms Pelosi, but claimed they do not want border security for “strictly political reasons”.

“If the Democrats do not give us the votes to secure our Country, the Military will build the remaining sections of the Wall. They know how important it is!” Mr Trump tweeted.

The two Democrats said on Monday that Republicans have the power to keep the government open since they control Congress and the White House.

“Our country cannot afford a Trump shutdown,” they said in a statement, adding that the president “knows full well that his wall proposal does not have the votes to pass the House and Senate and should not be an obstacle to a bipartisan agreement”.

Republican congressional leaders have repeatedly said it is up to Mr Trump to cut a deal with Democrats, an acknowledgment of their inability to produce spending bills with Republican votes alone.

That gives Democrats some momentum heading into the closed-door talks, which also could veer into Mr Trump’s request for emergency funding for deadly wildfires in California and a Republican-sponsored bill to extend expiring tax breaks and delay some health care taxes.

Before legislators adjourn for the year they also may consider a bipartisan criminal justice reform bill, a law to protect special counsel Robert Mueller, and a plan to overhaul the system for handling sexual harassment complaints on Capitol Hill.

By far the biggest unresolved issue is the border wall. Mr Trump wants the next funding package to include at least 5 billion dollars (£4 billion) for it, an idea Democrats have flatly rejected.

Ms Pelosi and Mr Schumer have urged him to support a bill that includes half a dozen government funding bills largely agreed upon by legislators, along with a separate measure that funds the Department of Homeland Security at current levels until September 30.

The homeland bill includes about 1.3 billion dollars (£1 billion) for fencing and other security measures at the border.

If Mr Trump rejects that, Democrats are likely to urge a continuing resolution that funds all the remaining appropriations bills at current levels until September 30, an aide said.

Ms Pelosi said she and many other Democrats consider the wall “immoral, ineffective and expensive” and noted that Mr Trump promised during the 2016 campaign that Mexico would pay for the wall, an idea Mexico has repeatedly rejected.

Protecting borders “is a responsibility we honour, but we do so by honouring our values as well,” she said last week.

Mr Schumer said Democrats want to work with Mr Trump to avert a shutdown, but said money for border security should not include the concrete wall Mr Trump has envisioned. Instead, the money should be used for fencing and technology that experts say is appropriate, he said.

“We do not want to let a Trump temper tantrum govern our policies or cause the shutdown of a government, which everyone on both sides of the aisle knows is the wrong idea,” he said.