At a rally in Des Moines on Friday evening, Mr. O’Rourke told supporters he made his decision “so recently and so reluctantly.’’

“We have to clearly see at this point that we do not now have the means” to continue, he said, adding: “Though this is the end of this campaign, we are right in the middle of this fight.”

In a hallway outside the venue of an Iowa Democrats dinner, where Mr. O’Rourke had been scheduled to appear, a black-draped table for his campaign was abandoned Friday night.

Passers-by helped themselves from the roll of “Beto” stickers sitting on the table, near a cardboard box full of one-sheet guides to “our most common cheers.”

“So sad!” a woman exclaimed as she walked by. “It’s so sad.”

Mr. O’Rourke entered the 2020 primary in the middle of March with the aura of a celebrity, cheered by rank-and-file Democrats and admired by no less a figure than former President Barack Obama for his near-miss challenge to Senator Ted Cruz in the nation’s largest red state. He effectively unveiled his run for the White House in a cover story for Vanity Fair in which he declared he was “just born to be in it.” He later described the cover, along with his choice of words, as a mistake.

In the earliest days of his campaign, Mr. O’Rourke was a fund-raising powerhouse, collecting more than $6 million in his first day as a candidate. But his fund-raising cratered almost immediately. He raised more in his first 48 hours than in the following 100 days, and steadily depleted his campaign treasury by spending more than he was taking in.