DES MOINES, Iowa—Former U.S. Rep. Beto O’Rourke said Friday he was dropping out of the Democratic presidential race after failing to catch fire with voters in a crowded field.

He vaulted from a little-known, three-term member of Congress from Texas to a political celebrity when he challenged incumbent Republican Ted Cruz for the U.S. Senate in 2018, a race Mr. O’Rourke lost narrowly. But he stumbled in his presidential run, and prospects looked weak headed into the first primary contests next year.

His...