Rep. Eric Swalwell, D-Calif., announced Monday that he was ending his 2020 presidential bid, saying he had to "be honest" with how his campaign was going.

He becomes the second candidate to formally exit the race, following former Democratic West Virginia state Sen. Richard Ojeda's brief foray into the presidential contest earlier this year.

"I told my wife and our staff and our constituents and our supporters that we're only running for one reason — to win and make a difference," Swalwell said, adding that "being honest with ourselves, we had to look at how much money we were raising" and at polling.

Swalwell, who had built up somewhat of a national profile through his positions on the House Intelligence and Judiciary committees and had sought to focus his campaign on gun control, never saw his White House bid take off.

"Today ends our presidential campaign, but it is the beginning of an opportunity in Congress with a new perspective," he said, adding that he had "no regrets" from his short run.

Swalwell estimated that he raised a paltry $850,000 during the second quarter, though he said those numbers were not final.

"We wanted to be honest with ourselves," he said. "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."

During the first debate last month, Swalwell, 38, took aim at former Vice President Joe Biden and older Democrats, as he said they needed to "pass the torch" to a new generation of leaders.

Swalwell recently canceled a series of Fourth of July events in New Hampshire, touching off rumors that he planned to exit the race.

Now, he will run for re-election to his House seat — something that had earlier been in doubt. Swalwell already faces a primary challenger in that race, Hayward City Council member Aisha Wahab, a progressive Afghan American.

In February, Swalwell told the San Francisco Chronicle that if he ran for president, he would "burn the boats," and not seek re-election to a fifth term in the House. By June, Swalwell was more ambiguous in an interview with The Hill, saying: "I'm running for president right now."

"Don't have to make that decision (on the House race) until December," Swalwell said. "We need this field to start shrinking so candidates can distinguish themselves. I hope to be part of the field as it shrinks. If I don't, I'm going to be realistic about my options."

Asked whom he would endorse for president, Swalwell on Monday praised the field and said he had not yet determined whom he plans to support.

"If Megan Rapinoe gets in the race, I think I'm going to endorse her," Swalwell said of the U.S. Women's National Soccer Team star.