One of the apparent silver linings of an otherwise disastrous 2016 presidential election was Donald Trump’s relatively poor performance in Texas. Trump bested Hillary Clinton by 9 percentage points in Texas, a far slimmer margin than the 16 percentage points by which Romney triumphed four years earlier.

Why did Trump do so poorly relative to previous nominees? My prior assumption, likely shared by many others who were too depressed to dive into the data, was that, in addition to increased Latino turnout, Clinton’s appeals to educated, white-collar Republicans that had fallen so flat in the Rust Belt had actually worked in the suburbs of Houston, Dallas and Austin, leading many country club Republicans to stay home or vote for Hillary.

That was until I read an analysis by Ed Espinoza, a long-time Democratic strategist who runs Progress Texas, a liberal outfit based in Austin. He pointed out that Trump’s narrower margin was most likely the result of new voters coming out for Hillary, not Republican voters deserting their nominee.

Indeed, Trump won Texas by a far slimmer margin than the three most recent GOP nominees despite the fact that he got more overall votes here than any presidential candidate in history.

It’s pretty simple. Trump got about what you’d expect a Republican candidate to get based on recent performances. In 2008, John McCain got 4.48 million votes. In 2012, Mitt Romney got 4.57 million, an increase of 90,000 votes. And in 2016, Trump got 4.68 million, an increase of 110,000.

In contrast, Hillary Clinton got 557,000 more votes than Obama.

Simply put, the Texans who died today were disproportionately Republican. Of those who turned 18, the great majority are Democrats.

If this trend continues, the GOP’s downfall in Texas isn’t likely, it’s assured. And without Texas, the national GOP is royally screwed.

The Lone Star State has provided the winning margin in the electoral college in the three most recent presidential contests that Republicans have won (2016, 2004, 2000). It now has 38 electoral votes, but it will likely get more in the coming years as its population continues to grow.

Just as important, the 25 GOP members of Congress from Texas are currently the difference between Paul Ryan and Nancy Pelosi being speaker of the House. Democrats will obviously never win all of those seats, but they will take over a fair number of them. The Republican gerrymandering will protect some GOP seats, but other Republican members of Congress will eventually find that the districts that were drawn to be solidly red for them in 2011 have since become much purpler.

Take Rep. John Culberton, a Republican who represents a district that includes much of Houston and suburbs to the west and north. The district is rated R+7 by the Cook Political Report, even though it’s only 38 percent white. That’s no doubt because not only do Latinos, who account for 31 percent of the district’s population, typically have low turnout, but because many of them are not citizens and therefore can’t vote (contrary to what the president apparently believes). Most of their kids, however, will be able to vote.

A similar paradigm shift will likely present headaches for Rep. Ted Poe, another Houston-area congressman whose district is only 37 percent white but is nevertheless currently rated R+11.

In total, 12 House Republicans from Texas represent districts that are less than 50 percent white.

Not all of them are likely to swing soon, if ever. For instance, the 19th district, comprised of the city of Lubbock and a massive swath of rural North Texas, has an enormous Latino population as well as small populations of African Americans, Asians and Native Americans. But as is the case throughout much of the rural south, its white population, which amounts to 46 percent of the population, is so solidly Republican that the district is currently rated R+27.

Most of the other Republican districts, however, are centered on Texas’ urban areas, where the vast majority of the state’s growing population lives. In those districts, demographic trends will put GOP rule at mortal risk.

Texas’ shifting demographics will not only translate into gains for Democrats in national political races, but it will open up a formidable laboratory of progressive urban policy-making. Instead of hostility from the state legislature, whose GOP leaders in recent years have delighted in passing laws to nullify liberal policies put in place by local governments, Texas’ urban areas may soon find the state Capitol to be an ally in their efforts on transit, affordable housing, economic development, criminal justice reform and environmental protection. Instead of watching Republican leaders here try to lure companies away from California with the promise of low taxes and lax regulations, we may very well one day see Texas competing with the Golden State as the premier bastion of liberal cosmopolitanism.

Not long ago, Democrats bemoaned the fact that it was red states, such as Texas and Arizona, that were gaining population and therefore growing in importance in politically, while bluish states in the Northeast and Upper Midwest saw their populations stagnate and their electoral significance decline. In the long-term, however, it is that population trend that will likely save them.