The top Democrat called on Mr. Trump’s family and aides to conduct an intervention with the president “for the good of the country”.
Mr. Trump hit back, saying Mrs. Pelosi was “crazy”, later calling the California congresswoman “a mess”.
The row marks a new low for relations between the White House and Democrats.
The exchange came a day after Mr. Trump abruptly cut short a meeting with Mrs Pelosi and her counterpart in the Senate, Democratic leader Chuck Schumer.
The fallout from the meeting – which the president ended in minutes – continued throughout the following day.
- The mental rigours of being US president
- Trump hits back at Democratic ‘cover-up’ claims
- Pelosi accuses attorney general of lying
In a response to a question at her weekly press briefing on Thursday, Mrs Pelosi said she was concerned for the well-being of the president “and the well-being of the United States of America”.
The speaker accused Mr Trump of a “temper tantrum”.
“I pray for the president of the United States,” Mrs Pelosi said. “I wish that his family or his administration or his staff would have an intervention for the good of the country.”
“Maybe he wants to take a leave of absence,” she added.
She also joked about the 25th amendment, the US constitution’s clause for removing a president, telling a reporter: “That’s a good idea.”
Mrs Pelosi depicted Mr Trump’s behaviour as “villainous”, citing his rejection of subpoenas, withholding documents and blocking testimony by current and ex-advisers.
Later at the White House, Mr Trump said Mrs Pelosi’s remark about an intervention was “a nasty-type statement”.
“Crazy Nancy,” he said. “I tell you what, I have been watching her for a long period of time, she’s not the same person, she’s lost it.”
He also said “she’s disintegrating before their eyes”.
The president also denied “screaming and yelling” during a meeting on Wednesday with the Democratic leadership, maintaining that he was in fact “extremely calm”.
Mr Trump, Mrs Pelosi and Mr Schumer met to discuss spending on crumbling US infrastructure, a rare possible area of agreement with the White House.
But Mr Trump ended the meeting after three minutes. Mrs Pelosi says Mr Trump pounded the table before storming out.
Almost immediately afterwards, he appeared in the Rose Garden to declare that he was ending all bipartisan co-operation with Democrats until they stopped their “phoney investigations”.
Media captionThe 25th Amendment: Could it be used to unseat Trump?
But on Thursday Republican lawmakers said Mr Trump had signed off on a cross-party aid package to deliver $19.1bn (£17bn) in disaster relief, including $1bn for Puerto Rico.
The long-stalled compromise excludes extra funding previously demanded by the president for the US border.
As rank-and-file Democrats call for Mr Trump’s impeachment, the House speaker meanwhile continued to warn against such a move, arguing that the president was goading her party to try to remove him from office.
“The White House is just crying out for impeachment, that’s why he flipped yesterday,” Ms Pelosi said on Thursday.
“Impeachment is a very divisive place to go.”
Shortly before Mrs Pelosi’s remarks the White House rebuked her for accusing the president on Wednesday of a “cover-up” over Russia’s alleged meddling in the 2016 US elections.
Press secretary Sarah Sanders told CNN: “It’s very hard to have a meeting where you accuse the president of the United States of a crime and an hour later show up and act as if nothing has happened.”