Tuesday night saw the completion of Virginia’s transformation from red to blue, as Democrats took control of both houses of the General Assembly for the first time in a generation.

The shift began a decade ago at the top of the ballot. Virginia voted for Republican presidential candidates in every race between 1968 and 2008, but it has not voted for one since.

Some of the forces at work were demographic: an influx of immigrants, a tech boom that brought a surge of highly educated and affluent residents to the northern suburbs.

But the wounds the Republicans have suffered have also been self-inflicted, as their party in Virginia was taken over by hard-line forces on the right.

These were the Republicans who in 2012 passed a bill requiring women who want an abortion to undergo an invasive and medically unnecessary ultrasound with a vaginal probe (and who backed off after becoming a national laughingstock). They also defeated House majority leader Eric Cantor in a 2014 primary because he didn’t share their ­anti-immigration fervor.

And this year, after the state was shaken by a mass shooting in Virginia Beach that left a dozen people dead, these were the Republicans who abruptly shut down a special legislative session on gun control after only 90 minutes without considering a single bill. That they were not even willing to contemplate expanding background checks or “red flag” laws to take weapons away from people deemed to be dangerous turned out to be a great gift to the Democrats in a year when voters named guns as their top concern.

The other force that has shifted the political axis in Virginia is the political activism of women.

Since President Trump has been in office, the gender gap among Virginia voters has risen dramatically. In the 2016 election, exit polling showed that women in Virginia were more likely than men to vote Democratic by 26 percentage points, only slightly higher than the national average; in the 2017 legislative races, that number had widened to 32 points.

And they are doing more than voting.

Of the 15 Republican House seats that flipped to Democrats in the 2017 election, female candidates won 11, bringing a record number of women to the chamber and putting it within a hair’s breadth of a Democratic majority.

Those women held on in Tuesday’s election and added to their numbers. Especially sweet for Democrats was the double-digit victory of Shelly Simonds, whose 2017 bid had ended in a tie. With control of the chamber on the line, it had to be settled by drawing a name from a bowl — and her Republican opponent was the one chosen.

Rarely have we seen a state make such a rapid and definitive political transformation. It may not be a bellwether for what lies ahead nationally, but Republicans would do well to consider it a reminder that when the tide is rising, it’s a good idea to quit swimming against it.

Read more: