When media outlets called the race for California's 21st Congressional District in favor of incumbent Republican Rep. David Valadao on election night, Democratic candidate TJ Cox knew the contest wasn't over.

“What we felt on the ground was something entirely different than what was being reported,” Cox said. His campaign looked at the reported vote cast and their projected turnout and declined to concede.

Over the next several weeks, Cox pulled ahead as more of the vote was counted. Multiple news outlets that had projected Valadao as the winner retracted their calls — including NBC News — and a month after Election Day, Cox was declared the apparent winner with an 862-vote advantage.

“Although the experts said that we never had a chance, the thing I know about experts ... is that experts are always right up until the point that they’re wrong,” he said. “We knew we had an opportunity to be successful and to win, which is exactly what’s happened.”

Cox is one of three Asian-American and Pacific Islander freshmen representatives-elect who are scheduled to be sworn into Congress next month. Joining him are Andy Kim, who won the seat to represent New Jersey's 3rd Congressional District, and Michael San Nicolas, who is slated to serve as a non-voting representative for Guam. The three new legislators will bring the total number of Asian Americans and Pacific Islanders elected to Congress to 20, a new high, according to the Congressional Asian Pacific American Caucus (CAPAC). The 115th Congress, with 18 elected Asian Americans and Pacific Islanders, was the previous high.

“Since its founding in 1994, CAPAC has always strived to ensure that diverse voices are represented in the halls of Congress, and we are thrilled that the American people voted overwhelmingly to elect candidates who better reflect the diversity of our nation,” Democrat Rep. Judy Chu, the caucus chair, said in a statement. “With these victories, CAPAC will have its highest AAPI membership in history and an important seat at the table within House Leadership.”

In their races, all three candidates faced and defeated incumbents.

Kim unseated Republican incumbent Rep. Tom MacArthur in New Jersey's 3rd Congressional District, winning by nearly 4,000 votes. His victory makes him the second Korean American elected to Congress, the first in more than 20 years.

Andy Kim speaks during a debate in Newark, New Jersey, on Oct. 31, 2018. Julio Cortez / AP file

Prior to his election, Kim had worked as an adviser to Gens. David Petraeus and John Allen, and for the White House as the director of Iraq at the National Security Council. He previously told NBC News that his decision to go into public service was prompted by the Sept. 11, 2001, terrorist attacks, which took place while he was in college.

In a November statement, Kim said his campaign was always about the people of New Jersey and who would best advocate for the hopes and needs of the community in Congress.

“Our campaign was about the issues — about affordable health care for all Americans; about fair taxes for New Jersey families; and about a government that works for the people,” he said. “I look forward to working on these and other key issues while representing my home district with integrity and civility in Washington.”

In Guam, San Nicolas, a senator in the U.S. territory’s legislature, defeated his Republican opponent, Dolores Flores Brooks, in November with 54.85 percent of the vote. In the June primaries, he unseated 15-year incumbent Rep. Madeleine Bordallo.

Before going into public office, San Nicolas worked as a high school history teacher and financial planner. He has said he felt called to serve and followed in the footsteps of his grandparents, who were former members of Guam's legislature.

Rep.-elect Michael San Nicolas, D-Guam, walks from member-elect briefings on Capitol Hill in Washington, on Nov. 15, 2018. Carolyn Kaster / AP file

In Central California, Cox's win brought the total number of seats flipped by Democrats to 40. He will also join Democrat Rep. Bobby Scott of Virginia to become one of two sitting members of Congress of Philippine descent.

Cox, an engineer and small businessman, previously ran for office in 2006. He lost, but credits that race for shaping him into a better candidate 12 years later.

“Before, I could hardly put two sentences together in front of a crowd,” he said. “The fact is, I’m an engineer. I’m not a practiced or a polished politician by any means.”

Despite that previous experience, Cox told NBC News earlier this year that he struggled with fundraising, securing volunteers, garnering family support, and remaining focused amid negative attacks and advice that it was necessary to attack his opponent.

Former U.S. President Barack Obama participates in a political rally for California Democratic candidates during a event in Anaheim, California on Sept. 8, 2018. Left to right are candidates Josh Harder (CA-10), TJ Cox (CA-21), Gil Cisneros (CA-39), Katie Porter (CA-45), Harley Rouda (CA-48) and Mike Levin (CA-49). Mike Blake / Reuters file

Four years after his first bid for Congress, Cox started the Central Valley New Market Tax Credit Fund, which helps direct federal investment to projects that promote areas including health, job creation and housing. Cox said his legislative priorities will focus on some of those same areas: healthcare and healthcare access; protecting social security, Medicare and Medicaid; job creation; and getting a clean DREAM act passed.

In a Facebook post, San Nicolas wrote that the opportunity to network with the large freshman class of representatives and to build relationships with its members is unprecedented in Guam's history.

“We have many new voices joining us in Congress who are now very much aware of our island, our struggles, our unresolved status, and our need for their help to move our issues forward given our voting limitations,” he wrote. “In my introductory remarks I stated plainly, 'We are a colony and we need your help to bring justice to the American people of the Territories.' Our call was received with resounding applause.”

He added, “Many are optimistic. Guam has many historic reasons to feel the same.”

Cox said it was moving to see the new faces from both parties in Congress that reflect the voice and experience of America.

“The class — and not only the Democrats, but the new Republican members that I’ve met in addition — we are all dedicated towards ... asserting the responsibility that the legislative branch has with regard to government,” he said. “On both sides, people have realized that over the last several years that the Congress has been working for the executive branch rather than directly working for the people. Well, this is a Congress that is focused and dedicated towards working for the people.”

Follow NBC Asian America on Facebook, Twitter, Instagram and Tumblr.