Top Democrats on Wednesday walked out of a White House meeting on Syria between President Donald Trump and congressional leaders when Democrats say Trump started insulting them, calling House Speaker Nancy Pelosi a "third-rate politician" and suggesting she should like ISIS because the terrorist group includes some former communists.

Senate Minority Leader Chuck Schumer, speaking to reporters afterward alongside Pelosi in the White House driveway, said, "He was insulting, particularly to the speaker. She kept her cool completely. But he called her a third-rate politician. He said that there are communists involved and you guys might like that. This was not a dialogue. It was sort of a diatribe, a nasty diatribe not focused on the facts."

Pelosi said the president was "shaken" because the House had just voted overwhelmingly, 354-60, on a non-binding resolution criticizing the president's decision to withdraw troops from northeastern Syria.

On returning to the Capitol, Pelosi continued her criticism.

“I think it’s a very sad commentary on the president of the United States that he doesn’t have enough confidence in what he’s doing to listen to other points of view – especially the overwhelming vote of the House of Representatives and have some level of respect for that,” Pelosi said. “It shook him up, melted him down and he behaved accordingly.”

"Very sad," she said. "It was very sad."

House Majority Leader Steny Hoyer, also in the meeting, said the subject of Trump's possible impeachment didn't come up but this was the first face-to-face meeting between her and Trump since she announced that the House would begin a formal impeachment inquiry, which earlier in the day he called "absolutely crazy."

As she has before, Pelosi said she prayed for the president, but this time she went a step further.

“I pray for his safety and that of his family, now we have to pray for his health because this was a very serious meltdown on the part of the president,” Pelosi said, later adding “I’m not saying mentally, I'm just talking about handling just handling the truth.”

She also said she recalled Trump calling her a "third-grade politician."

Trump also called James Mattis "the world's most overrated general," according to a senior Democratic aide. Mattis resigned as defense secretary at the end of last year when Trump at one point wanted to withdraw all U.S. forces from Syria and Mattis had said keeping U.S. forces was vital to keep ISIS in check. Trump, at the meeting, according to the Democratic aide, said Mattis "wasn't tough enough. I captured ISIS. Mattis said it would take two years. I captured them in one month."

Late Wednesday afternoon, White House press secretary Stephanie Grisham released a statement blasting Pelosi.

"The President was measured, factual and decisive, while Speaker Pelosi’s decision to walk out was baffling, but not surprising," Grisham said. "She had no intention of listening or contributing to an important meeting on national security issues. While Democratic leadership chose to storm out and get in front of the cameras to whine, everyone else in the meeting chose to stay in the room and work on behalf of this country."

House Minority Leader Kevin McCarthy and other Republicans in the closed-door meeting also gave a very different version of what happened.

"I see a pattern of behavior with Speaker Nancy Pelosi. She storms out of another meeting trying to make it unproductive. The other Democrats stayed and actually had a very productive meeting with the general from the Joint Chiefs, with the secretary of defense," McCarthy said.

He argued the meeting with Trump became more productive after the she left the room.

"I’ve been in a lot of meetings where individuals get heated with one another. I do not believe in that process, that you should get up and you walk away. The other Democrats did not walk away. They stayed in the room, and you know what happened when Speaker Pelosi left the room? McCarthy said. "They seemed pretty much calmer. It seemed much more productive. It seemed as though when the speaker was in the room, she was there for one reason and one reason only, and that’s really unbecoming of a speaker."

Earlier, Pelosi had tweeted that a classified full House briefing on Syria scheduled for Thursday afternoon had been canceled.

"I am deeply concerned that the White House has canceled an all-Member classified briefing on the dangerous situation the President has caused in Syria, denying the Congress its right to be informed as it makes decisions about our national security," she said.