Rep. Eric Swalwell (D-Calif.) speaks during the second night of the first Democratic presidential candidates debate in Miami, Florida, U.S. on June 27. (Mike Segar/Reuters)

Rep. Eric Swalwell (D-Calif.) on Monday became the first major Democratic presidential candidate to exit the race, as he announced he would suspend his campaign and focus instead on trying to win reelection to Congress next year.

Swalwell, who made last month’s debate stage but risked not qualifying to participate in the second debate this month, has not registered over 1 percent in national polling. He will face a primary challenge in his bid to return to his House seat for a fifth term.

At a news conference in Dublin, Calif., Swalwell said he is “fired up” to return to Capitol Hill and continue the work he has been doing in Congress.

“Today ends our presidential campaign, but it is the beginning of an opportunity in Congress with a new perspective shaped by the lives that have touched mine and our campaign throughout these last three months to bring that promise of America to all Americans,” Swalwell said.

He maintained that his short-lived presidential run was “not a vanity project” and argued that he had succeeded in pushing the Democratic front-runners to support his plan for an assault weapons buyback program.

As a presidential candidate, Swalwell, 38, offered himself as a fresh face from a younger generation to lead his party in its bid to unseat President Trump and emphasized his commitment to reducing gun violence.

The most memorable moment of his short-lived campaign came during the first debate in Miami when he quoted former vice president Joe Biden from three decades ago saying it was time to “pass the torch” to a new generation of leadership.

Swalwell stoked speculation about his future in the race after canceling a planned two-day trip to New Hampshire over the holiday weekend, saying he wanted to spend more time with his family.

Swalwell began considering a presidential bid after the 2016 election, making multiple trips to early primary states to campaign for down-ballot candidates and meet local Democrats. He traveled to Iowa, where he was born, more than a dozen times, and welcomed the speculation that he might seek the White House. If he ran, he said, he’d offer the sort of generational change that candidates like Biden and Sen. Bernie Sanders (I-Vt.) could not.

“I don’t think the same old leaders can be counted on to solve the same old problems,” Swalwell said in an interview with The Post last year, before speaking to the liberal group Progress Iowa. “If Republicans can just frame the election as, ‘Democrats want to go back to the third term of Obama,’ I don’t think we can win.”

But as a candidate, Swalwell struggled to break through. As part of his focus on gun safety, he proposed a national program to ban assault weapons, then buy back and destroy them, but otherwise aligned himself with the other liberals in the race.

As he put together a presidential bid, Swalwell told reporters that he was leaving the House.

“I don’t have a life insurance policy,” he told the San Francisco Chronicle in February.

That inspired several Democrats to look at running in the safe Bay Area district, led by local city councilor Aisha Wahab, who would be the first Afghan-American elected to Congress. In an interview last month, Wahab said she would “reassess” her race if Swalwell returned.

On Monday, Swalwell sought to clarify his past comments. He said he was referring to the potential situation in December, when his final decision on whether to pursue a House bid would be due. If Swalwell had still been a presidential contender at that point, he wouldn’t seek both offices, he said.

Asked whether he plans to endorse any of the other Democratic White House hopefuls, Swalwell said that he’s not making any decisions at the moment.

“I look forward now to being a citizen, watching the debates,” he said, adding that the best match-up against Trump would be someone who “lives in the present but never ever stops thinking about the future.”

Before launching his presidential bid, Swalwell had been a frequent guest on cable news programs because of his perch on the House Intelligence Committee, which provided an opportunity to opine on the investigation of special counsel Robert S. Mueller III.

In Congress, Swalwell is known for launching the Future Forum, a group of young Democratic House members focused on issues important to millennials like reducing student debt. The organization, which he chaired from when it started in 2015 until this year, gave him the chance to visit more than 50 cities around the country.

The group nearly doubled in size to 50 members after the 2018 midterm elections ushered in a younger crop of new lawmakers.

Though he has made efforts to ally himself with Speaker Nancy Pelosi (D-Calif.), Swalwell has frequently shown a willingness to go against the prevailing winds in his party.

He was one of the few Democratic House members to endorse a presidential candidate other than Hillary Clinton during the last election, instead backing former Maryland governor Martin O’Malley.

More significant, he successfully challenged Rep. Pete Stark in 2012, taking on a 40-year Democratic incumbent against the wishes of the party.

Felicia Sonmez and Annie Linskey contributed to this report.