Editor’s Note: The video above is from Oct. 31, 2022, when this story was first published. The story below has since been updated with data from the 2022 gubernatorial election.

KXAN (AUSTIN) — For the best part of three decades, Texas has been a Republican stronghold.

In fact, no Democrat has won statewide office since 1994. But the margin between Republicans and Democrats in recent years has been narrowing.

In the 2014 gubernatorial election, when Greg Abbott became governor, he beat Wendy Davis by more than 20 percentage points. By the 2022 gubernatorial election, Abbott’s margin of victory was cut to about 11 percentage points.

The margin in presidential elections have been even closer. Mitt Romney carried Texas in 2012 by about 16 percentage points. Donald Trump won the state in 2016 by 9 percentage points, and less than 6 percentage points in 2020.

What are the reddest and bluest counties?

The base of support for Democrats in the past several cycles has been in large cities, like Austin, Houston, Dallas and El Paso, and communities in South Texas and the Rio Grande Valley. Republicans have enjoyed strong support in more rural areas, like the Panhandle, West Texas and East Texas.

To determine the reddest and bluest counties, KXAN calculated the average margin of victory in each county using election results in the 2018 and 2022 gubernatorial elections and the 2016 and 2020 presidential elections.

Based on this average, Roberts County, northeast of Amarillo, is the reddest county in the state. Over the past four elections, the margin of victory for Republican candidates there has averaged 92.86 percentage points.

King County, between Lubbock and Wichita Falls, is right behind, with an average Republican margin of victory of 91.11 percentage points.

Eighteen other counties have average Republican margins of 80 percentage points or higher, and a further 45 have an average margin of 70 percentage points or higher. Of counties with more than 100,000 registered voters, Parker County, west of Fort Worth, is the strongest county for Republicans. GOP candidates there win on average by 66.86 percentage points.

On the opposite end of the spectrum, Zavala County, southwest of San Antonio, has the highest average margin of victory for Democrats. From 2016 to 2022 , Democratic candidates won by an average of 42.64 percentage points.

Four other counties have given Democrats an average margin of victory of more than 30 percentage points: Travis, Presidio, El Paso and Webb. Of counties with more than 100,000 registered voters, Travis County, home to Austin, gives Democrats the most support, with an average margin of victory of 41.71 percentage points.

Which counties are the closest?

Since 2016, four counties have been decided by less than 5 percentage points on average. The closest has been Frio County, southwest of San Antonio, which has given Democrats an average margin of victory of just 0.18 percentage points.

The next closest is LaSalle County, northeast of Laredo, which has given Republicans an average margin of 1.59 percentage points, then Jim Wells County, west of Corpus Christi, which has an average Republican margin of 2.88 percentage points.

Several of the closest counties based on averages since 2014 have seen significant changes in results over the past few cycles.

In Hays County, for example, Donald Trump won the 2016 presidential election with a 0.83 percentage point margin over Hillary Clinton. That’s compared to the 2022 gubernatorial election, in which Beto O’Rourke had an 11.02 percentage point margin over Greg Abbott.

Which counties have seen the biggest shifts?

KXAN looked at results in the 2014, 2018 and 2022 gubernatorial elections and 2016 and 2020 presidential elections to determine the average shift in each county between each election cycle.

Since 2014, several counties, especially in South Texas, have sprinted to the right, while suburban counties have marched leftward.

The most dramatic changes have happened in Zapata, Kennedy, Foard, Starr and Duval counties. In each election, Zapata County moved on average of 10.52 percentage points to the right, while Kennedy, Foard, Starr and Duval all shifted rightward by an average of more than 9 percentage points each cycle.

In total, 180 of the state’s 254 counties have seen average movement toward the Republicans each cycle, while 75 counties have shifted toward the Democrats.

Most notable is Collin County, home to Plano in the DFW Metroplex, which has seen an average leftward shift of 5.77 percentage points each election cycle. Williamson and Hays counties, suburbs of Austin, both moved to the left by an average of more than 5 percentage points each cycle.

On a statewide level, Texas has seen an average shift to the Democrats of 2.37% each election cycle since 2014.