Hours before polls opened for the Texas primary, Democratic presidential candidate Joe Biden arrived in Houston with a clear message.

"I am very much alive," the former vice president told an enthusiastic crowd at Texas Southern University, touting his campaign's fresh momentum after his triumph two days earlier in the South Carolina primary.

The Palmetto State breakthrough, however, came a day after early voting ended in Texas and over 1 million ballots were already cast in the state's delegate-rich primary. Was Biden's momentum too little too late to win Texas?

Not at all, it turned out Tuesday night, as Biden surged past Bernie Sanders to prevail in the Texas primary, 35% to 30%. With its 228 delegates, the state gave Biden his biggest prize on Super Tuesday, which included 13 other states that held their nominating contests.

Biden owed the Texas victory to a swell of support on election day that erased an early-vote deficit against Sanders and then further stretched his advantage, according to a Texas Tribune analysis of the results. Sanders beat Biden in the early vote, 28% to 23%, before Biden routed Sanders on election day, 45% to 31%.

More than two-thirds of Biden's total votes in the primary came on election day, a far higher proportion than any other candidates. Sanders got a more traditional 54% of all his ballots from election day.

Exit polls found that 22% of Texas primary voters made up their mind in the last few days — and they overwhelmingly went with Biden, who won 49% of the group to 20% for Sanders.

Sanders still ended up close to Biden in the Texas delegate count, taking 102 to Biden's 111. Plus, his supporters were pleased to see his strong performance with Latino voters and in many counties along the border.

"It was this kind of last-minute momentum from these individuals that dropped out of the race that gave [Biden] that push — we’re not denying that — but Bernie has a very sophisticated and a very well-thought-out ground game," said Marisa Marquez, one of Sanders' Texas co-chairs and a former El Paso state representative.

Biden's Texas win was anything but guaranteed heading into Tuesday. While he had long been at or near the top of Texas polls, Sanders was ahead in most surveys that came out in the run-up to Tuesday. Almost none of those polls, however, captured the period beginning with Biden's South Carolina rout.

One of the starker examples of Biden making up ground on election day came in the state's most populous county, Harris County, where Biden spoke Monday afternoon at TSU. At that point, Biden was effectively tied with Sanders in the county, getting 36,412 early votes to 36,094 for Sanders. But on election day, Biden picked up 84,799 votes to 55,806 for Sanders. Seventy percent of Biden's total votes in the county came on election day, while that figure was 60% for Sanders.

Biden's post-South Carolina high peaked Monday night in Dallas with events where he accepted the endorsements of three former rivals: Pete Buttigieg, Amy Klobuchar and Beto O'Rourke.

"I have never seen anything like that — to see that big of a momentum shift in such a short period of time," said state Rep. Chris Turner of Grand Prairie, who helped introduce Biden at his rally Monday night in Dallas. "The excitement was just palpable leading up to that rally on Monday, and then as the day went on ... I think everything just sort of all fed off of itself."

In Dallas County, Biden was already winning the early vote by a small margin, but he blew out Sanders the next day, winning 67,714 election day ballots to 38,615 for Sanders.

Biden ended up carrying all but a few dozen of Texas' 254 counties, including the three most populous, which cover Dallas, Houston and Fort Worth. He also won most of the suburban counties around those cities and broad swaths of more rural counties throughout southeast Texas, East Texas, West Texas and the Panhandle.

Sanders drew his biggest vote tallies from San Antonio's Bexar County, which he won by 5 percentage points, and Austin's Travis County, where he beat Biden by double digits and carried the two biggest suburban counties attached to it. Sanders has a special relationship with Travis County, home of the liberal bastion Austin — it was the only big-city county that he carried against Hillary Clinton in the 2016 primary.

This time around, Sanders also won most counties in the Rio Grande Valley and other parts of South and West Texas with heavily Hispanic populations, including El Paso County.

Statewide, Sanders nearly doubled Biden's support among Latino voters, according to exit polls. Biden, meanwhile, more than tripled Sanders' vote share among black voters.

Another sharp difference in exit surveys: age. Sanders carried voters ages 18-44 — 55% to 16% for Biden — while Biden won voters older than 45 — 44% to 20% for Sanders.

Sanders' Texas state coordinator, Chris Chu de León, argued Wednesday evening that Sanders had come a long way since finishing over 30 points behind Clinton in Texas.

"In 2020, we were less than 5 [behind] & overwhelmingly won Latinx and young voters," Chu de León wrote on Twitter. "We broadened our coalition through outreach to communities of color, students, & working people. Damn proud of our work here in Texas."

At the end of the day, though, Biden's win seemed to be most vividly illustrated by the ground he made up between early voting and election day. It was even on full display in a Sanders stronghold, Travis County, where Biden got an underwhelming 14,418 early votes. On election day, he won two and a half times as many votes.

Disclosure: Texas Southern University 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.