WASHINGTON — President Donald Trump has widened an extraordinary rift with his own party, as he threatened a government shutdown over his long-promised border wall and attacked key lawmakers whose votes he needs heading into a crucial legislative period.
The escalating tensions between the Republican president and the Republican Congress endanger delicate negotiations in the coming weeks to overhaul the tax system, keep the government running and avoid a costly default on the country's debt. They are the clearest signs to date that the uncomfortable alliance between Trump, who won the presidency promising to "drain the swamp," and Republican lawmakers who hoped to enact long-stalled conservative priorities, has begun to fray.
In a challenge to Republicans late Tuesday, Trump threatened to shut down the government in a matter of weeks if Congress did not fund the wall on the southern border that was a signature promise of his campaign for the White House.
"If we have to close down our government, we're building that wall," Trump told a raucous rally in Phoenix as his supporters chanted, "Build that wall!"
"The American people voted for immigration control — that's one of the reasons I'm here," he added. "One way or the other, we're going to get that wall."
On Wednesday, he followed up on the threat by attacking Sen. Jeff Flake of Arizona, a Republican who has said he is skeptical of building a wall between the United States and Mexico unless, as Trump promised, Mexico pays for it. Flake is one of two Republican senators up for re-election next year in a swing state, and the president has put his finger on the scale toward a primary challenger, Kelli Ward.
"Not a fan of Jeff Flake," Trump said in a Twitter post. "Weak on crime & border!"
And amid a frosty period in his relationship with Sen. Mitch McConnell of Kentucky, the majority leader, Trump questioned the Senate leader's approach, faulting Republicans for failing to blow up long-standing Senate rules that make most legislation subject to a filibuster that requires 60 votes to overcome.
"If Republican Senate doesn't get rid of the Filibuster Rule & go to a simple majority, which the Dems would do, they are just wasting time!" Trump said on Twitter, suggesting a change that McConnell and other Senate Republican leaders have repeatedly rejected.
McConnell on Wednesday sought to play down the friction between himself and the president, issuing a statement in which he insisted that their common legislative priorities were on track.
"The president and I, and our teams, have been and continue to be in regular contact about our shared goals," McConnell said. "We are working together to develop tax reform and infrastructure legislation so we can grow the economy and create jobs; to prevent a government default; to fund the government so we can advance our priorities in the short and long terms; to pass the defense authorization and defense appropriations bills so we can support our troops and help implement an effective strategy against ISIL; to provide relief from Obamacare; and to continue our progress for our nation's veterans."
Sarah Huckabee Sanders, the White House press secretary, echoed that statement and said the president and McConnell "will hold previously scheduled meetings following the August recess to discuss these critical items with members of the congressional leadership and the president's Cabinet."
But there is growing evidence of tensions that have erupted privately between the president and other senior Republicans as well. In a testy call this month, first reported by Politico, Trump vented angrily to Sen. Bob Corker, R-Tenn., the chairman of the Foreign Relations Committee, over Russia sanctions legislation he said would damage his presidency, according to a person familiar with the conversation. Corker insisted that he would not back down on the measure, which passed with overwhelming bipartisan support.
Yet Trump's threat Tuesday of a shutdown introduced new uncertainty to the ambitious wish list. It sharpened a suggestion that Trump made early this year, in the wake of a budget agreement he grudgingly accepted even though it omitted money for the wall, that the United States needed "a good 'shutdown'" this fall to force a partisan confrontation over federal spending.
Trump has asked Congress to allocate $1.6 billion this year toward building a wall along the roughly 1,900-mile border with Mexico. Currently, a mix of barriers — including chain-link fences and steel walls to keep people from crossing and steel beams to stop vehicles — stretches across about 650 miles of the border. So far, Congress has provided $341 million this year to repair and bolster the existing border barriers.
Overall, the Trump administration is seeking $3.6 billion for the border wall over the next two fiscal years. In the past, however, Mr. Trump has said there is no need for a wall along the entire border, which spans four states: California, Arizona, New Mexico and Texas.
Congressional leaders distanced themselves from the president's threat. Speaker Paul D. Ryan of Wisconsin said Wednesday in Oregon that no one wanted a dispute over the border wall to result in a lapse in government funding, adding that he did not believe that such a confrontation would be necessary.
White House officials said Trump's words were not meant as a legislative directive or veto promise so much as a message to lawmakers, including Democrats who have previously supported spending on border fencing.
"Protecting our borders is only controversial if you are looking for reasons to obstruct a long-standing and bipartisan effort," said John Czwartacki, a spokesman for the Office of Management and Budget.
Hard-line conservative nationalists such as Stephen K. Bannon, the chief strategist ousted from the White House last week, have counseled the president to take a hard line on wall funding to buck up his political base after the embarrassing defeat of legislation to repeal the Affordable Care Act. They have warned Trump that signing a funding bill that does not include substantial sums for the wall could would enrage his core supporters.
On the other hand, Trump's bare-knuckled tactics could alienate congressional Republicans when he can ill afford to lose their support.
The president wants to push through a tax overhaul by year's end, but first Republicans must approve a budget for the fiscal year that begins Oct. 1 to trigger special procedures that would allow the package to pass the Senate with only 51 votes, instead of the 60 required for most legislation.
A budget resolution is always difficult, but it will probably become entangled in another divisive issue, the debt ceiling: The Treasury Department has estimated that the government will reach its borrowing limit sometime in October, at which point Congress will have to vote to increase the debt limit to avoid a default.
Most immediately, the government will run out of money Oct. 1 unless Congress approves new government spending bills. But in that conflict, the president may have handed Senate Democrats the whip, while inoculating them from blame. They can now filibuster any spending bill that contains wall funding, forcing Republicans to strip out the money and challenge Trump to veto it.
"If the president pursues this path, against the wishes of both Republicans and Democrats, as well as the majority of the American people, he will be heading toward a government shutdown, which nobody will like and which won't accomplish anything," said Sen. Chuck Schumer of New York, the minority leader.
Rep. Nancy Pelosi of California, the minority leader in the House, said Trump's threat had made it clear that he was willing to sow chaos in the service of his top policy priority. "The president said he will purposefully hurt American communities to force American taxpayers to fund an immoral, ineffective and expensive border wall," she said.
Republicans privately vented their dismay at the president's tactics and language — especially his political maneuvering against their colleagues. The contest between Flake and Ward appears to have become something of a proxy fight between the president and the majority leader.
"I would just say that I think it's important that we all stay unified as Republicans to complete our agenda," Ryan cautioned.
But Sanders signaled that the president was willing to stoke such disputes if he believed it would serve his purposes.
"I think everybody knows this president isn't somebody who backs down," she told reporters on Air Force One as Trump returned to Washington on Wednesday. "If he thinks we need to lean in a little, I'm sure we will."
White House aides had urged Trump not to mention Flake by name at the Phoenix rally, which he instead used to savage the news media as unpatriotic and "sick," angrily defend his response to racially charged violence in Charlottesville, Virginia, and praise Joe Arpaio, the former Arizona sheriff whose aggressive immigration crackdowns led to a federal conviction for criminal contempt of court.
The president criticized Flake only obliquely in the speech — "Nobody knows who the hell he is," Trump said — and waited until Wednesday morning to take aim at the senator by name on Twitter.
In an interview Wednesday on "The Brian Kilmeade Show" on Fox News Radio, Flake said, "I will continue to support the president and work with him when I think he's right and challenge him when I think he is going in the wrong direction."
Trump appears to be in a fighting mood. Before his exit, Bannon repeatedly warned Trump and John F. Kelly, the White House chief of staff, that September could be the breaking point for the Trump presidency — "a total meat grinder," Bannon told them.
Conservatives will object to raising the debt ceiling unless it contains some provisions to help rein in government spending — an unlikely scenario. Instead, Ryan and McConnell will have to rely on Democratic votes to pass the increase — putting the president in the awkward position of having to sign it despite repeatedly promising to tackle the country's debt.
Bannon warned White House colleagues that that could send the conservative House Freedom Caucus into open revolt against the speaker. To placate them, Bannon counseled, the White House must extract wall funding at all costs.
Eileen Sullivan, Jeremy W. Peters and Jonathan Martin contributed reporting.