MADISON, Wis. — The race for Wisconsin Supreme Court, the first statewide contest of 2018, is shaping up to be a measuring stick for both Republicans and Democrats as they attempt to gauge voter feelings headed into the fall midterm election.

The Supreme Court race is officially nonpartisan but Madison attorney Tim Burns is openly touting his liberal credentials, Sauk County Circuit Judge Michael Screnock is largely backed by conservatives and Milwaukee County Circuit Judge Rebecca Dallet argues she’s the only moderate.

The political views of the three candidates were prominent at a debate Monday hosted by the conservative Federalist Society in Milwaukee.

Burns told Federalist Society members in his opening statement that “you weakened our democracy to the point that we elected a perverse show-dog named (President Donald) Trump to lead our great nation,” the Wisconsin State Journal reported.

Dallet and Burns often clashed while Screnock looked on.

“The goal here is to improve the Supreme Court, to make sure it works better and improve the terrible, partisan reputation,” Dallet said. “By your own behavior, Mr. Burns, you have shown you cannot do that.”

Screnock said he found his opponents’ political speech “deeply troubling” and promised his election would help keep the court from returning to liberal control.

The two highest vote-getters in the Feb. 20 Supreme Court primary will face each other in the April 3 general election to replace conservative Justice Michael Gableman who is not seeking a second term. The court is currently controlled 5-2 by conservatives.

“This race will be a test of if an outright liberal and progressive message carries the day in an environment in which the support of the party in power and its president are at historic lows,” Burns said in a statement to The Associated Press. “A spring victory in the Wisconsin Supreme Court race will energize the base and help build a movement toward a big November win.”

Both liberals and conservatives will work to turn out their supporters, and the results can then be analyzed and compared to past Supreme Court elections to see who is performing better, said Republican strategist Brandon Scholz.

That will make it more instructive than last week’s special election for an open state Senate seat, said Scholz, a former state GOP director who’s worked on past Supreme Court races for conservative candidates.

Democrats were buoyed last week by the surprise, upset win in the special state Senate election in northwest Wisconsin where about 22,000 people cast ballots. That’s just a tiny sampling of the turnout expected for the Supreme Court race, which has fluctuated in recent years from about 800,000 to nearly 2 million.

Burns is a longtime Democratic donor who is openly courting liberals, breaking with tradition and practice to take positions on current issues and blast conservative control of the Wisconsin Supreme Court and state government.

Screnock previously worked as an attorney defending Republican-drawn legislative maps and GOP state senators targeted for recall in 2011 over their support for Gov. Scott Walker’s union restrictions.

Walker appointed Screnock to the bench in 2015. As a college student in 1989, Screnock was twice arrested for taking part in anti-abortion protests, something he has said during the campaign he does not regret doing.

Screnock’s campaign advisers both have a deeply partisan background.

Sean Lansing is a former Republican operative who also previously worked for the Koch brothers group Americans for Prosperity in both Wisconsin and Virginia. And Luke Hilgemann is the former state director of Americans for Prosperity in Wisconsin and CEO of Americans for Prosperity nationwide.

Lansing, who works at Madison-based Champion Group as a political consultant, said liberals were targeting the Wisconsin Supreme Court contest.

“I still believe voters will reject such over the top, partisan rhetoric in the Supreme Court race, but I’m sure there are lot of special interest groups on the left urging both Burns and Dallet to double down on messages that will appeal to the far-left crowd,” he said.

Dallet, who raised more money than either Screnock or Burns last year, has tried to pitch herself as the only truly nonpartisan candidate in the race.