AUSTIN, Texas (AP) — Republican Texas Gov. Greg Abbott sought a record-tying third term Tuesday while Democrat Beto O’Rourke reached for an upset in America’s biggest red state in one of the most expensive midterm races in the U.S.

More than 5 million early votes had been cast ahead of Election Day in Texas, where anger over the Uvalde school shooting that left 19 children and two teachers dead in May intensified an already heated contest in which both candidates’ campaigns combined spent more than $200 million.

Five months later, state police still face pressure for failing to confront the gunman sooner at Robb Elementary School. O’Rourke said the shooting, one of the deadliest classroom attacks in U.S. history, crystalized the stakes of the election as Abbott waved off calls for tougher gun laws. O’Rourke also has sought to animate voters over Abbott signing an abortion ban that makes no exceptions for rape or incest.

But Abbott, 64, has remained formidable in a state where Republicans have won every governor’s race since 1994.

He has rallied his base around a record number of illegal border crossings from Mexico to the U.S., aggressively courted Hispanic voters in South Texas, and seized on economic anxieties and recession fears that have created headwinds for Democrats nationally.

More than 4 in 10 Texas voters rank the economy and jobs as the most important issue facing the country, according to AP VoteCast, an expansive survey of more than 3,200 voters. Nearly 8 in 10 rate the U.S. economy as poor or not so good. Only about two-thirds say they are confident they can keep up with their expenses.

Voters are sharply divided over abortion. Roughly equal proportions either favor a law guaranteeing access to legal abortion nationwide or oppose it. But about 8 in 10 say legal abortion should be allowed if a pregnancy is a result of rape or incest. Voters slightly favor Abbott’s decision to send migrants seeking asylum in the U.S. to northern Democratic states, with nearly 6 in 10 favoring the move.

A victory by Abbott would strengthen his position as a potential presidential contender in 2024, secure his place as the second-longest serving governor in the state’s history and extend decades of GOP dominance.

O’Rourke on Tuesday embarked on one last campaign blitz through Dallas, San Antonio and Houston before heading home to wait for election returns in his hometown of El Paso. Abbott was spending election night Tuesday in the southern border city of McAllen, underscoring the GOP’s rising confidence in a region that has long been a stronghold for Democrats.

O’Rourke’s hard-charging challenge has rekindled Democrats’ hopes while appealing to voters soured by the Uvalde shooting, the abortion ban and the deadly collapse of the state’s power grid in winter 2021. The former El Paso congressman has cast himself as a fresh start for Texas and a check on a GOP-controlled Legislature, while vowing to legalize marijuana and expand Medicaid.

Roughly 8 in 10 Texas voters say the U.S. Supreme Court ruling overturning Roe v. Wade, which recognized a constitutional right to abortion, was a factor in their votes. But only 1 in 10 say it is the top issue facing the country.

Four years after O’Rourke, 50, nearly won a U.S. Senate seat in Texas, raising his profile in the Democratic Party, he has confronted more skeptical voters. Abbott has painted him as a liberal crusader, and O’Rourke has been forced to answer for positions he took while running for the White House, particularly his support of mandatory gun buybacks.

A day after the Uvalde shooting, O’Rourke interrupted an Abbott news conference, telling him, “This is on you,” in reference to the governor’s opposition of tougher gun measures. To Republicans, the moment was a tasteless political stunt, but O’Rourke’s supporters saw it as an authentic reflection of their anger.

During early voting in suburban Dallas, Deborah Thompson said she voted for all Democrats, including O’Rourke, out of concern that Republicans threaten voting and abortion rights.

“I think that an 18-year-old girl that’s been raped should be able to get an abortion,” the 56-year-old Richardson resident said. “I’m not going back. I’m not going back to the ’50s … and I’m so angry at all of this.”

Janie Helms, a retiree, said worries about inflation led her to vote for Abbott.

“I see him as a conservative who will watch our money,” she said.

____

Associated Press writer Jake Bleiberg in Plano, Texas, and Terry Tang in Phoenix contributed to this report.

____

Follow AP’s coverage of the elections at: https://apnews.com/hub/2022-midterm-elections

Check out https://apnews.com/hub/explaining-the-elections to learn more about the issues and factors at play in the 2022 midterm elections.