Rep. Eric Swalwell (D-Calif.) dropped out of the 2020 Democratic presidential primary on Monday, making him the first major candidate in the crowded 2020 primary field to end a presidential bid.

"We have to be honest about our own candidacy's viability," Swalwell told reporters at a press conference at his campaign headquarters in Dublin, Calif.

"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 me and my campaign over the past few months," he continued.

The Hill had reported earlier on Monday that Swalwell planned to put an end to his campaign, citing a source close to him.

The lawmaker had canceled Independence Day events in New Hampshire last week, sparking the initial speculation about his plans.

Swalwell, who is a close ally of Speaker Nancy Pelosi (D-Calif.) and a member of the House Intelligence Committee, instead said he will focus on his reelection bid for his fifth term in the lower chamber.

He will face progressive Hayward City Council member Aisha Wahab in the fifteenth district's Democratic primary.

He won his general election race in 2018 easily, with 73 percent of the vote.

Swalwell said he was impressed by the 2020 presidential primary field, but had not yet made a decision on who he would endorse, though he joked that he would happily support U.S. soccer star Megan Rapinoe after the team won the Women's World Cup on Sunday.

"If Megan Rapinoe gets in the race, I think I'm going to endorse her," Swalwell joked during his press conference.

The California lawmaker has lagged in polls in the presidential contest, despite taking part in the first series of debates late last month.

A Washington Post/ABC News poll conducted June 29 to July 1 showed Swalwell polling at zero percent among Democratic primary and caucus voters.

Swalwell has yet to announce his fundraising for the second quarter - a key metric that could force other presidential candidates to drop out as well.

The lawmaker estimated during the press conference that his campaign had raised roughly $850,000 from 21,000 donors in the second quarter, adding that the figures were not final.

"If there was a viable chance, I wouldn't be standing here today. I didn't want to mislead my family, my staff, our supporters, my constituents," Swalwell said.

Swalwell made gun control the centerpiece of his presidential campaign, calling for legislation aimed at combating gun violence.

"On the issue of gun violence, I am the champion who is saying enough is enough, and that has to be a top priority. We can't just respond to the last mass shooting. I want to challenge our candidates to make it a priority too," Swalwell told The Hill last month.

The Democratic congressman has also touted his youth as a plus in the Democratic primary and even told former Vice President Joe Biden to "pass the torch" to younger generations during the first Democratic debates last month.

Swalwell's exit would still leave about two dozen Democrats running for the White House, including former Alaska Sen. Mike Gravel, who has said he's running just to get on the debate stage.

West Virginia state Sen. Richard Ojeda (D) briefly entered the race before bowing out in January.

But the Democratic field could still grow larger, with former Georgia gubernatorial nominee Stacey Abrams yet to declare her intentions after ruling out a Senate run in 2020.

Meanwhile, Tom Steyer, the billionaire activist who has pushed for President Trump's impeachment, may still enter the race, according to The Atlantic.

-- Updated at 5:07 p.m.