Rep. Seth Moulton of Massachusetts repeatedly has said he’s not a quitter.

But on Friday, the three-term congressman and U.S. Marine veteran who served four tours of duty in the Iraq War ended his long-shot bid for the Democratic presidential nomination.

“I am ending my campaign for president,” Moulton announced during a speech Friday in San Francisco at the Democratic National Committee’s summer meeting.

MOULTON ADMITS NOT QUALIFYING FOR DEBATES MAKES WHITE HOUSE BID MORE 'CHALLENGING'

“Though this campaign is not ending the way we hoped, I am leaving this race knowing that we raised issues that are vitally important to the American people and our future," he emphasized.

The congressman also urged fellow Democrats that "we need to spend these next months doing everything we can to determine who our strongest nominee will be. And as we do so, we can’t be distracted by the latest outrage on Twitter or the reality show politics of the day."

And in a warning for the party not to move too far to the left, he pleaded that Democrats "stay grounded in what it’s going to take to win over voters—all kinds of Democrats, Independents like the Obama-Trump voters, and even disaffected Republicans—and bring the country together around beating Donald Trump."

Moulton’s move comes as it was all but certain he wouldn’t reach the thresholds set by the DNC for candidates to make the stage at the third round of primary debates, which will be held next month. The congressman failed to qualify for the first and second round of debates.

Moulton’s dropping out of the race comes just two days after Jay Inslee ended his White House bid. The longtime climate crusader and former congressman announced yesterday that he would run for a third term as Washington state's governor.

Last week another lower-tier candidate – former two-term Colorado Gov. John Hickenlooper – also ended his presidential campaign. On Thursday he announced a bid for his state’s Democratic Senate nomination, in hopes of challenging Republican Sen. Cory Gardner in next year’s election.

And last month long-shot Rep. Eric Swalwell of California dropped out of the White House race.

THE LATEST FROM FOX NEWS ON THE 2020 PRESIDENTIAL CAMPAIGN

Even with these departures, there are still roughly 20 Democrats running for their party’s presidential nomination.

In an interview with Fox News earlier this month, Moulton said he’s “not a quitter.”

But he acknowledged that if he failed to make the debates in September and October “it definitely makes it more challenging” to continue his White House bid.

And he said that “obviously if I get to a point where I just don’t see breaking out, then I would try to find who I think would be the next best nominee to take on Trump and get behind him or her.”

Moulton emphasized that one of the reasons he ran for president was he believed “it’s the best way to serve the country because I don’t think there’s a better nominee to take on Donald Trump. I think the image of a young combat veteran going up against the guy who’s a draft dodger on stage is exactly what we need to win.”

In his speech in San Francisco on Friday, Moulton announced that he’s now running for re-election.

“While this is the end of my campaign, it is certainly not the end of our efforts,” he’ll say. “I will once again be running for Congress in the 6th District of Massachusetts, my home, and I can’t wait to get back at it.”

Fox News’ Andres del Aguila contributed to this report.