AUSTIN, Texas (KXAN) — 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, in which Greg Abbott became governor, he beat Wendy Davis by more than 20 percentage points. By the 2020 presidential election, the margin of victory between Republican Donald Trump and Democrat Joe Biden had slimmed to just over 5 percentage points.

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, 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 2014 and 2018 gubernatorial elections and the 2016 and 2020 presidential elections.

Based on this average, King County, located between Lubbock and Wichita Falls, is the reddest county in the state. Over the past four elections, the margin of victory for Republican candidates there has averaged 91.49%.

Roberts County, northeast of Amarillo in the Panhandle, is right behind, with an average Republican margin of victory of 91.44%.

Twelve other counties have average Republican margins of 80% or higher, and a further 42 have an average margin of 70% of higher. Of counties with more than 100,000 registered voters, Parker County, home to Weatherford, west of Fort Worth, is the strongest county for Republicans. GOP candidates there win on average by 65.96%.

On the opposite end of the spectrum, Zavala County, southwest of San Antonio, has the highest average margin of victory for Democrats. From 2014 to 2020, Democratic candidates won by an average of 46.65%.

Nine other counties have given Democrats an average margin of victory of more than 30%. 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 37.3%.

Which counties are the closest?

Since 2014, nine counties have been decided by less than 5% on average. The closest has been La Salle County, northeast of Laredo, which has given Republicans an average margin of victory of just 0.22%.

The next closest is Hays County, which has given Democrats an average margin of 0.65%, then Jim Wells County, west of Corpus Christi, which has had an average Democratic margin of 0.8%.

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, Greg Abbott won the 2014 gubernatorial election with a 10.83% margin over Wendy Davis. That’s compared to the 2020 presidential election, in which Joe Biden had a 9.41% margin over Donald Trump.

Which counties have seen the biggest shifts?

KXAN looked at results in the 2014 and 2018 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 Starr, Duval and Zapata counties, all in South Texas. In each election, Starr County moved on average 17 percentage points to the right, while Duval and Zapata shifted rightward about 15 and 14 percentage points respectively.

In total, 118 of the state’s 254 counties have seen movement toward the Republicans each cycle, while 136 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 9.58% each election cycle. Brazos, Denton and Bell Counties have all moved to the left by an average of more than 8% each cycle.

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