Donald Trump took to Twitter, accusing Nancy Pelosi of having a "meltdown".

US President Donald Trump on Wednesday defended as "strategically brilliant" his decision to pull US troops out of Syria as the House of Representatives overwhelmingly condemned the move in a rare bipartisan rebuke.

A total of 129 members of Trump's Republican Party joined Democrats as the House denounced the withdrawal of US troops from northern Syria in a 354-60 vote.

The joint resolution called on Turkish President Recep Tayyip Erdogan to immediately halt military operations against Kurdish militants in Syria.

In a sign of Trump's deteriorating relationship with Congress, where the House is conducting an impeachment inquiry, Democratic House speaker Nancy Pelosi and Senate minority leader Charles Schumer walked out of what they said was an acrimonious White House meeting with Trump.

Schumer said Trump had called Pelosi a "third-rate politician" while the speaker said the president had experienced a "meltdown."

Trump then took to Twitter, accusing Pelosi of having her own "meltdown," while adding that the Democratic leader "needs help fast!"

"There is either something wrong with her 'upstairs,' or she just plain doesn't like our great Country," the president wrote.

Faced with mounting bipartisan criticism in Washington over the abrupt pullout of US forces from Syria, Trump denied he had given Erdogan a "green light" to launch operations against the Kurds.

"President Erdogan's decision didn't surprise me because he's wanted to do that for a long time," Trump told reporters earlier in the day at the White House. "He's been building up troops on the border with Syria for a long time."

The US president disparaged the Kurdish allies he abandoned in the face of the Turkish offensive, saying they were "not angels," as well as his Republican critics at home.

"I didn't give him a green light," Trump said of a telephone conversation he held with Erdogan prior to the Turkish incursion. "Just the opposite of a green light.

"I wrote a letter right after that conversation, a very powerful letter," he said.

In the letter dated October 9, Trump told Erdogan "you don't want to be responsible for slaughtering thousands" of people and urged him not to be a "tough guy" or a "fool."

"History will look upon you favorably if you get this done the right and humane way," Trump wrote.

Trump emphasized to reporters that US troops were out of harm's way and that the fallout from the US withdrawal was for Syria, Turkey and Russia to work out among themselves.

"I view the situation on the Turkish border with Syria to be, for the United States, strategically brilliant," Trump said. "Our soldiers are out of there, our soldiers are totally safe. They've got to work it out.

"Turkey has gone into Syria. If Turkey goes into Syria, that's between Turkey and Syria -- it's not between Turkey and the United States, like a lot of stupid people would like you to believe," he said.

Trump spoke as Vice President Mike Pence and Secretary of State Mike Pompeo prepared to travel to Turkey to try to persuade Erdogan to halt the offensive.

PKK 'Worse' Than ISIS

Trump expressed confidence that US nuclear weapons stored at Turkey's Incirlik air base were secure, despite flaring tensions between Ankara and its NATO allies over the Syrian incursion.

And he minimized the escape of ISIS terrorists who had been held by the Kurds as an attempt to "make us look like, 'Oh, gee, we have to get right back in there.'"

Critics have warned their escape gives the terrorists an opportunity to regroup after having lost their caliphate in Syria to US forces and their Kurdish allies. The UN Security Council on Wednesday adopted a unanimous statement warning of the risk of a terrorist "dispersion" in the region.

As for the Kurds, Trump said they "know how to fight and as I said, they aren't angels. They are not angels if you take a look."

Trump said the Kurdish rebel PKK, who have waged a decades-long insurgency against Ankara, were "probably" a bigger terror threat than the ISIS.

"The PKK, which is a part of the Kurds, as you know, is probably worse at terror and more of a terrorist threat in many ways than ISIS," he said.

Trump lashed out at critics of his withdrawal decision, particularly Senator Lindsey Graham, an influential Republican who has been a staunch defender of the president.

"Lindsey Graham would like to stay in the Middle East for the next thousand years with thousands of soldiers fighting other people's wars," Trump said. "I want to get out of the Middle East."

"Let them fight their own wars," he said. "They've been fighting for a thousand years."

Graham shot right back, in comments to US reporters, that Trump was making "the biggest mistake of his presidency" in Syria.