WASHINGTON (AP) — Will he or won't he?

President Donald Trump is sowing confusion about whether he's committed to keeping the government open through the fall elections or would willingly shut it down to secure more money for his promised wall at the U.S.-Mexico border.

Trump on Tuesday escalated his public threats of a government shutdown, even as he has told aides privately that he won't make any move until after the midterm elections. The president tweeted Tuesday that he did not care about the "political ramifications," adding that "a Government Shutdown is a very small price to pay for a safe and Prosperous America!"

His comments followed several days of shutdown threats in which he declared he saw "no problem" in shutting down the government to secure backing for one of his key campaign promises. But two officials said Trump recognized the political cost of a shutdown before the November elections and had assured staff he wouldn't provoke a fiscal crisis until after Election Day. A congressional aide said the White House had sent a similar message to Capitol Hill amid widespread anxiety about a potential shutdown as Republicans face tough re-election fights.

The two officials and the congressional aide spoke on condition of anonymity because they were not authorized to publicly discuss internal deliberations.

White House spokesman Hogan Gidley told reporters aboard Air Force One that Trump is focused on fulfilling his border security promise.

"Whether a shutdown happens before or after the elections his focus is getting the problem fixed," he said.

Trump's shutdown comments appeared to put him further at odds with Republicans in Congress. The threats came days after GOP leaders believed they had secured a pledge of Trump's patience on the budget.

A shutdown when government funding expires at the end of September, just weeks before the midterm elections, would be the third under unified Republican control of Washington, following stoppages in January and February. With Congress likely needing to pass a short-term spending bill before the new fiscal year, aides have emphasized that Trump would get another opportunity to force a showdown with Democrats over the border wall during a lame-duck session.

The president is eager to stress immigration during the fall election —and his own 2020 effort — believing it will fire up his base. Republican leaders disagree, hoping they can avoid a high-profile display of dysfunction and focus their message on the GOP tax cuts and the strong economy.

Trump has proved to be an inconsistent negotiating partner with Capitol Hill, as evidenced by his most recent mixed messages on a potential shutdown. Earlier this year he publicly weighed vetoing a government spending bill he had backed just days earlier, facing criticism from conservative allies that it didn't address his immigration priorities.

The president has made no secret of his belief that his hard-line immigration policies boosted him to the Oval Office, and he launched an aggressive push for additional border security measures early this year. They include $25 billion toward construction of a wall along the U.S.-Mexico border, but Trump acknowledged on Monday his demands are a starting point.

Republican leaders believed they had an understanding with Trump last week when they met at the White House to discuss strategy ahead of the budget year that starts Oct.1. After the meeting, Senate Majority Leader Mitch McConnell told a radio interviewer that a shutdown so close to the Nov. 6 midterm elections wouldn't happen. He said the border funding issue in particular would probably have to wait until after the elections.

But on Sunday, Trump reversed course in a surprise tweet: "I would be willing to 'shut down' government if the Democrats do not give us the votes for Border Security, which includes the Wall!"

"Must get rid of Lottery, Catch & Release etc. and finally go to system of Immigration based on MERIT!" he tweeted.

With time short, lawmakers appear most likely to approve a short-term funding measure to keep the government open through Election Day. That would set up another fiscal showdown during a lame-duck session.

Trump campaigned on a promise of building a wall to deter illegal immigration and to make Mexico pay for it. Mexico has refused, leading Trump to look to U.S. taxpayers to fund the endeavor instead, at least for now.

Trump has gotten some wall money from Congress, and likely will get more, though the total is well short of the $25 billion he has requested.

He also wants changes to legal immigration, including scrapping a visa lottery program. In addition, Trump wants to end the practice of releasing immigrants caught entering the country illegally on the condition that they show up for court hearings. And he wants to shift the U.S. immigration system to one based more on individual merit and less on family ties. Democrats and some Republicans have objected to those proposals.

Both chambers will have a short window to act before government funding expires at midnight Sept. 30.

The House is in recess and won't return until after Labor Day. The Senate will stay in session for most of August, except for a weeklong break scheduled to begin Aug. 6. McConnell canceled most of his chamber's recess to give senators time to work on the annual spending bills.

House Republicans released a spending bill this month that would provide $5 billion next year to build Trump's wall, a plan Trump supports.

____

AP writer Ken Thomas contributed to this report.