– President Donald Trump faced off against both parties in Congress on Wednesday in an extraordinary confrontation over his decision to abandon America’s Kurdish allies as the vast majority of House Republicans joined Democrats to condemn his policy in an overwhelming vote.

Trump found himself increasingly isolated after withdrawing troops from Syria and clearing the way for a Turkish offensive against Kurds who had fought alongside the United States. The president all but washed his hands of the conflict, saying that it “has nothing to do with us,” generating withering criticism from Republicans and leading to a stormy clash with Speaker Nancy Pelosi.

Bereft of supporters and under pressure from an impeachment inquiry, Trump spent much of the day defending his decision and lashing out against rivals. He dismissed the Kurds, who until last week shared outposts with U.S. soldiers, saying they were “no angels” and fought for money. And he berated Pelosi as a “third-grade politician” or “third-rate politician,” depending on the version, prompting Democrats to walk out of a White House meeting.

“I think now we have to pray for his health,” Pelosi told reporters afterward. “This was a very serious meltdown on the part of the president.” She said Trump seemed “very shaken up” by the cascade of criticism.

Trump said it was the other way around. “Nancy Pelosi needs help fast!” he wrote on Twitter. “She had a total meltdown in the White House today. It was very sad to watch. Pray for her, she is a very sick person!”

The collision in the Cabinet Room came shortly after the House voted 354-60 for a nonbinding resolution expressing opposition to Trump’s decision to abandon the Kurds, a measure that drew support from two-thirds of the House Republican caucus and all three of its top leaders. Senate Republicans spoke out individually Wednesday, warning that Trump was courting “disaster,” as one put it.

The fireworks erupted as Vice President Mike Pence, Secretary of State Mike Pompeo and Robert O’Brien, the president’s new national security adviser, left for Turkey in an effort to persuade President Recep Tayyip Erdogan to agree to a cease-fire in Syria.

But Trump’s commitment to that diplomacy seemed in doubt as he declared that the United States had no real interest in the matter. “That has nothing to do with us,” he said, adding: “It’s not our border. We shouldn’t be losing lives over it.”

Trump dismissed concerns that his decision to pull back had opened the way for Russia, Iran, the Syrian government and the Islamic State group to move into the abandoned territory and reassert influence in the area. “I wish them all a lot of luck,” Trump said of the Russians and Syrians.

Trump’s approach upended decades of U.S. policy in the Middle East, a region presidents of both parties have considered vital to the United States. While many presidents have been reluctant to commit troops to conflicts there, they rarely brushed off the importance of the region’s disputes so dismissively nor accepted the influence of Russia or other hostile players so readily.

But Trump argued that he ran for president on a platform of ending “endless wars,” a pledge that resonated with many Americans tired of nearly two decades of overseas military operations.

Critics in both parties denounced the president’s decision. Sen. Mitch McConnell, R-Ky., the majority leader, opened his weekly news conference by expressing his “gratitude to the Kurds,” adding, “I’m sorry that we are where we are.”

Sen. Mitt Romney, R-Utah, said that by sending Pence and Pompeo to Turkey, Trump was trying to fix a problem of his own creation, but too late.

“It’s very hard to understand why it is the vice president and secretary of state and others are going to talk with Erdogan and Turkey,” Romney told reporters. “It’s like the farmer who lost all his horses and goes to now shut the barn door.”

Trump had little patience for Pelosi when she and other congressional leaders of both parties arrived at the White House for a briefing on the fighting. It was the first time the president had been in the same room with her since she declared the opening of an impeachment inquiry last month, and while the topic did not come up, the room crackled with friction.

When Sen. Chuck Schumer, D-N.Y., the minority leader, cited Trump’s former defense secretary Jim Mattis on Syria, the president cut him off. Mattis, a retired Marine general, was “the world’s most overrated general,” Trump said, according to a Democratic account of the exchange.

“You know why?” Trump said. “He wasn’t tough enough. I captured ISIS. Mattis said it would take two years. I captured them in one month.”

According to the Democratic account, Pelosi at one point noted that President Vladimir Putin’s Russia has always wanted a “foothold in the Middle East” and now has one.

“All roads with you lead to Putin,” she told Trump.

Trump suggested that the Democrats liked the Kurds in part because they included some communists. He lashed out at Pelosi. “In my opinion, you are a third-grade politician,” he told her, according to the speaker. (Schumer and the White House both recalled the insult as “third-rate politician.”)

When Pelosi and Rep. Steny Hoyer of Maryland, the House majority leader, stood to leave, Trump called out, “Goodbye, we’ll see you at the polls.”

Particularly angering critics in both parties Wednesday was Trump’s cavalier attitude toward the Kurdish troops who have been America’s most reliable ally against ISIS militants. Seven times during two public appearances Wednesday, Trump used some variation of the phrase “no angels” to describe the Kurds and suggested they fought out of their own financial interest.

“We’re making the Kurds look like they’re angels,” he said at one point. “We paid a lot of money to the Kurds. Tremendous amounts of money. We’ve given them massive fortunes.”

Echoing Erdogan’s talking points, the president compared one faction of the Kurds to ISIS and asserted that Kurds intentionally freed some ISIS prisoners to create a backlash for Trump.

But he denied that he gave Erdogan a green light for the incursion when he agreed to remove several dozen troops from the border, who had served effectively as a trip wire deterring any Turkish operation. To prove his point, he cited a letter he wrote the Turkish president last week.

“History will look upon you favorably if you get this done the right and humane way,” Trump said in the Oct. 9 letter to Erdogan, which was obtained by Fox Business Network on Wednesday and confirmed by a White House official. “It will look upon you forever as the devil if good things don’t happen. Don’t be a tough guy. Don’t be a fool! I will call you later.”

Even as he discussed the conflict, Trump effectively confirmed the presence of 50 nuclear weapons at the Incirlik Air Base in Turkey, violating the long-standing tradition of not publicly acknowledging where such arms are.

Pentagon officials said Wednesday that the first several dozen U.S. military forces had left northern Syria, the start of a withdrawal that will ultimately pull out nearly 1,000 troops in coming weeks.