Wisconsin Governor Scott Walker did everything he could to prevent an election to fill the vacant State Senate seat representing northeast Wisconsin’s historically Republican District 1. Now we know why.

In a district that President Trump took in 2016 by a 56-38 margin in 2016, and that Walker took in 2014 by a 61-38 margin, Democrat Caleb Frostman won Tuesday’s special election that the governor tried to block. Frostman’s victory continued a national trend of Democrats “flipping” Republican seats. The Democratic Legislative Campaign Committee celebrated the win as “the 44th legislative district to flip from red to blue since the 2016 election.”

The Wisconsin flip was particularly sweet for Democrats, as it represented a huge setback for Walker and his Republican allies in a State Senate that has rubber-stamped the governor’s assaults on unions, voting rights, the environment, and public education. Carolyn Fiddler, who tracks legislative races for Daily Kos, described the result as “Walker’s worst nightmare,” and that’s a fair assessment.

After eight years of dominating the state, Walker is running for a third term in 2018 and trying to retain control of a Senate chamber that has been the key legislative battleground during his tenure. But, suddenly, the Republicans look vulnerable—so vulnerable that even the governor has begun to fret about the prospect that a “blue wave” might sweep over the state this fall.

That’s a far cry from 18 months ago. The 2016 election left Walker’s Republicans with a daunting 20-13 advantage in the Wisconsin Senate.

In January of this year, however, Democrat Patty Schachtner flipped a Republican seat in a special election in northwest Wisconsin. The GOP advantage fell to 19-14 and Walker admitted the result was “a wake-up call for Republicans.” The governor knew that another special election loss would put GOP control in jeopardy this November, when several swing seats are up for grabs.

Walker had already signaled that he would not call a special election to fill the District 1 seat—and another for a vacant State Assembly seat. Following Schachtner’s win, Walker dug in his heels.

Media outlets, public-interest groups, and Democrats in the legislature ripped Walker’s plan to leave almost 250,000 Wisconsinites unrepresented for the better part of a year—arguing that the governor was blocking elections that Republicans might lose. Walker dismissed the objections.

Residents of the unrepresented districts raised legal and constitutional concerns about the governor’s failure to respect state statutes that require legislative vacancies to be filled with prompt special elections. Walker refused to respond to those concerns.

When a legal team organized by former US attorney general Eric Holder took the case of the unrepresented Wisconsinites into the courts, Walker ordered his lawyers to battle it at every turn.

A Dane County Circuit Court judge who was appointed by Walker ordered the governor to call the elections. Walker rejected the verdict and had his lawyers seek a delay in the judgement so that the governor’s legislative henchmen could radically rewrite the state election law so that vacancies could go unfilled.

Another circuit court refused to delay the order. Walker’s lawyers made an emergency appeal to the state’s 2nd District Court of Appeals.

Appeals Court Judge Paul Reilly absolutely and unequivocally rejected the claim by the governor’s legal team that the special elections were an unnecessary waste of taxpayer resources. “Representative government and the election of our representatives are never ‘unnecessary,’ never a ‘waste of taxpayer resources,’ and the calling of the special elections are as the Governor acknowledges, his ‘obligation’ to follow by virtue of [state statute],” read the court order from Judge Reilly, which said Walker “has an obligation to follow the law just as do we.”

Defeated at every turn in his attempt to dismantle democracy in Wisconsin, Walker finally surrendered. In late March, the governor called the special elections—clearing the way for the voters of the two districts to choose their representatives on Tuesday.

The Assembly contest saw a significant advance for the Democrats. Despite the fact that the district had been radically gerrymandered to favor the Republicans, Democrat Ann Groves Lloyd ran well ahead of previous Democratic nominees. Where the Republican candidate won by 17 points in 2016, the GOP advantage was narrowed to just eight points. But the Republicans held on.

It was different in the Senate contest. Frostman, a local economic-development official, mounted a spirited progressive campaign against a right-wing Republican. While his opponent touted a record of helping Walker advance an agenda of social conservatism and union bashing, the Democrat campaigned as a supporter of reproductive rights, LGBTQ rights, and labor rights.

Frostman told voters that “It is time for our state to prioritize public education, repair our broken infrastructure, protect our public lands, and advance policies that help people succeed, like access to affordable healthcare and childcare.” Running in a waterfront district that is a popular vacation spot, he put particular emphasis on clean water and environmental issues, declaring that he would fight to “[conserve] the natural areas that make our corner of Wisconsin so incredibly special.”

The voters agreed, flipping a district that the Republican candidate won by 23 points in 2014 to one where the Frostman prevailed by three points. The dramatic swing was the first Democratic win for the seat since the “Watergate election” of 1974.

The Republican Senate advantage is down to just 18-15. And Democrats have already identified the two seats they think they can flip in November and take the chamber.

On Tuesday night, Kerry Schumann, the politically savvy executive director of the Wisconsin League of Conservation Voters, celebrated a win for “a conservation champion” that “sent a clear message tonight that clean water, abundant natural resources, and public health are priorities for every Wisconsinite.” She was right about that. But she was also right to remind Wisconsinites and observers from afar that “This election almost didn’t happen. Governor Scott Walker was frightened by who might win and he tried to skirt the law. Wisconsin is brimming with people tired of their state being abused by the corporate polluters who keep Walker in power. In November, the same folks who elected Caleb Frostman will know what to do.”