(CNN) Former Maryland Gov. Martin O'Malley announced Thursday that he will not run for president in 2020, writing in the Des Moines Register that he hopes former Democratic Rep. Beto O'Rourke runs instead.

O'Malley, who ran for the Democratic nomination in 2016 and spent the last two years traveling the country for Democrats, writes that he was impressed with O'Rourke's failed Senate bid in 2018, calling it a "courageous" campaign that "brought people together in Texas" and "sparked imaginations all across our country."

"I believe we need new leadership to make that future a reality," O'Malley writes. "And, I believe the new leader who can best bring us together and turn us around to create that better American future, is Beto O'Rourke."

Despite O'Rourke's loss in his run for Senate to Republican Ted Cruz, his youth and ability to compete in a red state has captivated some Democratic voters, vaulting him above some longtime Democratic heavyweights in early polls . O'Rourke has publicly left the door open to a 2020 run.

O'Malley ran a longshot bid in 2016 and eventually failed to break through a Democratic primary field dominated by former Secretary of State Hillary Clinton and Vermont Sen. Bernie Sanders.

Read More