Speaking at a rally in Tupelo, Mississippi, Mr Trump launched an attack on the former Texan congressman, just hours after he announced he was ending his bid to become the Democratic challenger for 2020.
“Poor b***ard,” said Mr Trump “Pathetic guy.”
He added: “”He came out of Texas a very hot political property, and he went back as cold as you can be.”
The president then mocked Mr O’Rourke’s arm gestures, adding: “What is he on?
Mr Trump was roundly criticised by Mr O’Rourke this summer in the aftermath of a mass shooting at a Walmart store in El Paso.
The 47-year-old, who had formerly represented the Texas border city, accused Mr Trump of stirring the kind of racist bigotry that allegedly led to the killing of nearly two-dozen people.
Mr O’Rourke, who also called for the president to act on gun control, rose to national attention in 2018 with his closely fought challenge to Republican senator Ted Cruz.
However, he was never able to rekindle that kind of passion during his presidential bid, and on Friday he announced he was ending his campaign.
Speaking to supporters in Iowa, Mr O’Rourke said that while his campaign was ending, he planned to stay active in the fight to defeat Mr Trump. “I will be part of this and so will you,” he said.
Mr O’Rourke was urged to run for president by many Democrats, including supporters of former president Barack Obama, who were energised by his narrow Senate loss.
“Though it is difficult to accept, it is clear to me now that this campaign does not have the means to move forward successfully,” he wrote in a Medium post formally announcing the end of his campaign.
“Acknowledging this now is in the best interests of those in the campaign; it is in the best interests of this party as we seek to unify around a nominee; and it is in the best interests of the country.”
Additional reporting by Associated Press