Senate leaders on Thursday were trying to come up with a short-term plan to reopen the government as President Trump warned he has “other alternatives” — meaning declaration of a national emergency to fund his border wall and end a 35-day standoff.

After failing to pass either a GOP-sponsored bill with $5.7 billion for the wall or a competing Democratic measure with no wall funding, Senate Democratic leader Chuck Schumer huddled with Senate Majority Leader Mitch McConnell on a deal that would reopen the government for three weeks while they continued to negotiate border security.

But Trump, speaking to reporters from the White House later in the afternoon, took a wait-and-see approach — while insisting that his long-promised wall had to be funded one way or another.

“I have other alternatives if I have to, and I’d use those alternatives if I have to, but we want to go through the system. We have to have a wall in this country,” he said.

CNN reported that the White House was drafting a national emergency order that would allow the president to tap more than $7 billion for the wall and end the shutdown.

“The massive amount of aliens who unlawfully enter the United States each day is a direct threat to the safety and security of our nation and constitutes a national emergency,” a draft of the order reportedly reads.

The president said he was open to any “reasonable” compromise that included a “prorated down payment” for his US-Mexico border barrier.

But House Speaker Nancy Pelosi quickly shot down any amount of wall funding as a nonstarter.

“That is not a reasonable agreement between the senators,” she said.

Only one Democrat, Sen. Joe Manchin of West Virginia, voted in favor of the GOP bill.

GOP Sens. Tom Cotton of Arkansas and Mike Lee of Utah voted no, and the final tally was 50 in favor and 47 against, a vote Trump called a win even though it was far short of the 60 votes needed for passage.

“I think we did very well,” Trump said. “But we need 60 votes because of the 60-vote rule, and so I just really want to thank the Republicans for holding.”

A competing bill sponsored by Democrats also went down to defeat, 52-44.

Six Republicans bucked the commander-in-chief and voted for the Democrats’ bill: Lamar Alexander of Tennessee, Susan Collins of Maine, Cory Gardner of Colorado, Johnny Isakson of Georgia, Mitt Romney of Utah and Lisa Murkowski of Alaska.

The number fell far short of the 14 defections needed to pass the Democratic measure.

Either bill would have reopened federal agencies and paid 800,000 federal workers who are furloughed or being forced to work without pay, and who apparently will miss another paycheck this week.

With wires