Massachusetts U.S. Rep. Seth Moulton is ending his long-shot bid for the Democratic nomination for president.

"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," the Marine veteran and 6th District congressman said at a Democratic National Committee meeting Friday afternoon.

Moulton announced he's running for re-election for his North Shore congressional seat, and that he "will be campaigning my a-- off for whoever wins our [presidential] nomination in 2020."

"Donald Trump is going to be harder to beat than most people think," he said. "But we can, and we must, beat him—because our country, our values, and our future depend on it."

Moulton's campaign never gained traction. The third-term congressman joined an already-large field of Democrats in April, presenting himself as a candidate of generational change and emphasizing his service background.

During a conference call with reporters Friday, Moulton said entering the race in April, later than most of the other candidates, was a mistake.

Asked by WBUR why he could no longer see a path to the nomination, Moulton said the race for the Democratic presidential nomination has narrowed to former Vice President Joe Biden, Vermont U.S. Sen. Bernie Sanders and Massachusetts U.S. Sen. Elizabeth Warren.

"Unfortunately, I think this has become a three-way race, essentially, and I don't say that as a political pundit," Moulton said. "You just look at the polling and that's kind of where it is right now. I'm not going to complain about the DNC rules being unfair. They are what they are, but I don't think that they've set up a very smart process for picking the best nominee to take on Donald Trump."

Moulton did not meet the polling and fundraising thresholds to qualify for two Democratic debates over the summer, and had not qualified for September's debate.

In the latest poll of likely Democratic primary voters in neighboring New Hampshire, from Suffolk University and the Boston Globe, Moulton received 0% support from respondents.

Moulton said the DNC's decision to keep candidates out of televised debates unless they meet specific thresholds of donors and poll numbers handicapped the very people who might be the strongest candidates against Trump, such as a combat veteran like himself or a Democratic governor from a state that Trump won, such as Montana's Steve Bullock.

David Gergen, a Harvard University professor and former political consultant who is one of Moulton's mentors, had previously categorized Moulton's bid for the Democratic nomination as "the longest of long shots."

Reached on Friday, Gergen said Democrats may not be interested in a candidate who fought in Afghanistan or Iraq anymore.

"He ran as someone who had been courageous and defending the country, and indeed, he had been," Gergen said. "He had a wonderful resume for America of about five years ago. The focus for Americans has withdrawn from Iraq and Afghanistan. The focus has shifted back to the domestic scene."

Moulton, who is originally from Marblehead, attended Harvard and served four tours of combat in Iraq.

Additionally, Gergen had told WBUR that Moulton set himself back among many Democrats by opposing Nancy Pelosi’s re-election as speaker of the U.S. House.

He now faces at least three primary challengers for his North Shore congressional seat.

Dominick Pangallo, chief of staff for a fourth potential challenger, Salem Mayor Kim Driscoll, told WBUR Friday "Mayor Driscoll is not challenging Congressman Moulton."

In his speech Friday, Moulton said he plans to relaunch his political action committee, Serve America, which he said "helped take back the House last cycle by electing 21 service-driven Democrats in tough districts across America."