WASHINGTON (Reuters) - Democrat Beto O’Rourke dropped out of the crowded 2020 U.S. presidential race on Friday, saying it had become clear his campaign did not have the resources to continue to seek his party’s nomination.

“My service to the country will not be as a candidate or as the nominee. 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,” O’Rourke wrote in a post that he shared on Twitter.

A former Texas congressman, O’Rourke was struggling to qualify for the next Democratic debate after months of poor showings in opinion polls and lackluster fundraising.

O’Rourke, 47, who became a Democratic rock star after almost winning a U.S. Senate seat in Texas in 2018, is not expected to run for the Senate next year, although party leaders are expected to urge him to run.

“We will work to ensure that the Democratic nominee is successful in defeating Donald Trump in 2020. I can tell you firsthand from having the chance to know the candidates, we will be well served by any one of them, and I’m going to be proud to support whoever she or he is,” O’Rourke’s Twitter post said.

His withdrawal leaves 17 Democratic contenders for the nomination to run against the Republican president.

After a gunman at a Walmart store killed 22 people in August in his home city of El Paso, O’Rourke shifted the focus of his campaign to gun control, traveling not only to early primary states but areas where previous massacres had taken place.

Slideshow ( 7 images )

Coming from the Texas border city, O’Rourke was also one of the most unrelenting critics of Trump, especially over his plans to build a border wall and his immigration policies.

“We took the boldest approach to gun safety in American history; we confronted institutional, systemic racism and called out Donald Trump for his white supremacy and the violence that he’s encouraged against communities that don’t look like, pray like or love like the majority in this country,” O’Rourke said in an email to supporters shortly after announcing he was quitting the race.

Reacting to the news of O’Rourke’s withdrawal, Trump tweeted on Friday: “Oh no, Beto just dropped out of race for President despite him saying he was “born for this.” I don’t think so!”

In March, when O’Rourke launched his campaign, he was quoted in a Vanity Fair profile as saying: “I’m just born to be in it.”