WASHINGTON — Sen. Rand Paul, R-Ky., on Thursday said he was holding up legislation Congress needs to pass by midnight to avert a government shutdown.

Paul is seeking a vote to restore budget caps Republicans and Democrats want to ease to massively increase defense and non-defense spending for a larger spending bill they hope to pass next month.

In a Fox News interview, Paul said he wants Senate Majority Leader Mitch McConnell, R-Ky., to allow 15 minutes of debate on his amendment, which he said would record the dissatisfaction of fiscal conservatives.

Paul said he got a call from President Donald Trump earlier in the day and asked Trump to persuade McConnell to agree.

“I think the president wants a resolution, and I think the best way to a resolution is get Sen. McConnell involved and tell him to get a 15-minute vote,” Paul said. “I’m happy to stay up until three in the morning for something I consider to be important.”

The two-year budget deal, tacked on to a six-week stopgap spending measure, would pump $300 billion more into military and domestic programs.

In a floor exchange between Senate leaders and Paul, McConnell had said it was time to vote.

“Here we are at a quarter to 6, funding for the government expires in just a few hours,” McConnell said. “The bipartisan agreement before us funds our troops at the level requested by the Pentagon, addresses the opioid crisis which is extremely big in the state of Kentucky and around the country, funds our veterans and many other shared priorities.”

Sen. Chuck Schumer, D-N.Y., told Paul there are many Democratic amendments proposed, “and it’s hard to make an argument that if one person gets an amendment, that everybody else won’t want an amendment, and then we’ll be here for a very long time.”

GOP leaders declined to open up the budget process to amendments because they have little time before government funding runs out. Instead, they offered Paul an opportunity to make a point-of-order, but he declined, kicking off what promised to be a lengthy floor speech.

Paul is not the only Republican objecting on fiscally conservative grounds. The bill is expected to pass the Senate, but its path is more complicated in the House, where House Freedom Caucus members said they will vote “no,” forcing GOP leaders to rely on Democratic votes.

Republican leadership has embraced the argument the deal will add funding for a depleted military, stretched too thin. But Paul’s answer was to scale back the military’s missions.

“We just have too much war. The war in Afghanistan is costing us $50 billion a year,” Paul said. I could give a raise to every soldier out there we’d just come home from Afghanistan. It’s time to come home.”

The hiccup added to the drama-filled week, as the House and Senate have been working to pass the legislation before funding runs out at midnight. That bill also includes a sweeping deal to suspend the debt ceiling, extend tax cuts and fund disaster relief efforts.

The government reopened fewer than three weeks ago after a brief shutdown, which bought more time for lawmakers to wrangle over immigration, spending and other issues.