MJ Hegar and Royce West are advancing to a runoff for the Democratic nomination to challenge U.S. Sen. John Cornyn, R-Texas.

Hegar, the former Air Force helicopter pilot backed by national Democrats, clearly established herself as the leading vote recipient Tuesday night in the 12-way primary. However, it was not clear until Wednesday afternoon that West, the Dallas state senator, was the runner-up. With almost all polling locations reporting, Hegar had 22% of the vote and West 14.5%.

"I believe we are well-positioned to win the runoff," West said in a statement thanking his competitors for their ideas and effort. "The runoff is a brand new day."

On Wednesday night, Hegar issued a series of tweets congratulating West and saying she is "looking forward to engaging in a lively conversation with voters across our state about the best path to move forward our Texas values."

West was closely followed in the results by political organizer Cristina Tzintzún Ramirez, who got 13.2% and conceded late Wednesday afternoon. Tzintzún Ramirez had positioned herself as one of the most progressive candidates in the primary, earning endorsements from U.S. Rep. Joaquin Castro and Alexandria Ocasio-Cortez of New York.

"This campaign was consistently underestimated," Tzintzún Ramirez said in a statement. "I ran as a progressive, as a Latina, and as a working mom. We ran this campaign unapologetically, and we all have so much to be proud of for what we’ve accomplished."

Throughout Tuesday night and Wednesday morning, it remained unclear who would join Hegar in the runoff as thousands of votes were still uncounted in the state's largest counties. On Wednesday morning, West said the race "remains too close to call" and that his campaign was waiting for more results before commenting further.

Hegar's first-place finish was apparent Tuesday night. Hegar took the stage at her election night party around 10 p.m., telling supporters that they are "walking into the runoff in the strongest possible position." She ended her speech with a message for Cornyn.

"Your time is done because you've sold us out," Hegar said. "We've given you plenty of time, and it's over. You're fired. Pack it up, buttercup."

The Democratic primary played out in the shadow of Beto O’Rourke’s blockbuster near-miss loss to U.S. Sen. Ted Cruz in 2018. However, none of the 12 candidates was able to come close to O’Rourke’s star power, and polls showed the field was widely unknown up through the final days before the primary.

Hegar, who waged a surprisingly competitive U.S. House campaign two years ago in the Austin suburbs, was among the first serious Democratic candidates to declare against Cornyn, launching her bid in April. She went on to become the top fundraiser in the primary, even as it filled up with several other legitimate candidates, and in December earned the endorsement of the Democratic Senatorial Campaign Committee.

Hegar leaned hard on her background as a military hero and working mom, presenting herself as the “badass” best suited to go toe to toe with Cornyn. Along the way, she resisted some of the more liberal positions of her primary competitors.

West ran on his 27 years of experience in the Texas Senate, and he had the support of most of his Democratic colleagues in the Legislature. He has said Texas needs "an experienced leader to stand up to" President Donald Trump.

There was little drama in the primary apart from a few episodes. Most of Hegar’s rivals were harshly critical when the DSCC endorsed her, denouncing it as Washington meddling and dismissive of the diversity of the state. (Hegar is white.) Hegar and Tzintzún Ramirez also shared tensions over their competing ideologies and campaign finance.

Both Hegar and Tzintzún Ramirez saw significant outside spending on their behalf in the primary’s final few weeks. VoteVets, a national group that works to elect Democratic veterans running for office, spent over $3 million boosting Hegar on TV through its super PAC. A newer super PAC, Lone Star Forward, invested six figures on the air to help Tzintzún Ramirez.

Tzintzún Ramirez in particular built some late momentum in the primary, landing the endorsements from Castro and Ocasio-Cortez once early voting began.

As the Democrats waited to see who else would qualify for the runoff, Cornyn claimed victory in his primary during an election night party in Austin. He faced four little-known challengers.

"We are united as one party, and we go into the general election stronger than we have ever been before," Cornyn said at the party. "The stage is now set for ... the referendum of our lifetimes: Will Texans abandon the principles that have made our state the envy of the nation in order to live under the stranglehold of socialism, or will Texas do what we've always done — choose freedom, prosperity, the power of self-determination?"

Cornyn did not mention his Democratic challengers, but on Wednesday evening, the National Republican Senatorial Committee weighed in on the runoff qualifiers.

"The Texas Democrats running for Senate are in a race to the left, desperate to rubber-stamp the socialist agenda of candidates like Bernie Sanders and Elizabeth Warren," NRSC spokeswoman Joanna Rodriguez said in a statement.

Polls in recent weeks made clear Hegar was the favorite to advance to a runoff, while the No. 2 spot was less certain. Hegar was already looking forward to the overtime round during a get-out-the-vote event Monday evening in the Houston area.

“We gotta do it all again in May. I need y’all with me in May,” she said, heralding the potential for a runoff as a sign of Democratic ascendancy in long-red Texas. “I’m so excited about a runoff because, frankly, growing up in this state, I don’t remember a lot of competitive Democratic primaries and runoffs.”

Disclosure: The Texas secretary of state has been a financial supporter of The Texas Tribune, a nonprofit, nonpartisan news organization that is funded in part by donations from members, foundations and corporate sponsors. Financial supporters play no role in the Tribune's journalism. Find a complete list of them here.