By SCOTT BAUER Associated Press

MADISON, Wis. (AP) — The Wisconsin Supreme Court race that liberals needed to win to have a shot at taking majority control of the court next year appeared headed for a recount, with the conservative candidate holding a narrow lead following Tuesday’s election.

A conservative victory would increase their majority to 5-2 and ensure their control over the court, which they’ve held since 2008, for years to come. It would be a particularly stinging defeat for liberals, who were confident and riding a wave of wins in 2018, including picking up a Supreme Court seat and ousting Republican Gov. Scott Walker.

Conservative Brian Hagedorn, who was Walker’s chief legal counsel for five years, led liberal-backed Lisa Neubauer by about 1,600 votes out of nearly 1.2 million cast, based on unofficial results. That is a difference of about 0.14 percentage point, close enough for Neubauer to request a recount at taxpayers’ expense.

“This race is too close to call,” Neubauer campaign manager Tyler Hendricks said in a statement. “We are almost assuredly headed to a recount. We are going to make sure every vote is counted. Wisconsinites deserve to know we have had a fair election and that every vote is counted.”

Counties will canvass the vote starting next week to determine the official margin of victory.

The last time there was a recount in a Wisconsin Supreme Court race was in 2011.

This year’s contest, the only statewide election of the year, was also viewed as a barometer of voter moods heading into the 2020 presidential year. Turnout was strong at about 26%, beating the 2018 Supreme Court turnout of 22%, and the tight outcome provides more evidence of how evenly divided Wisconsin is.

President Donald Trump carried the state by less than a percentage point, and Walker lost by just over 1 point.

The Wisconsin Supreme Court has been the final word in some of the most partisan battles in the state over the past decade. It has upheld several polarizing laws passed by the Republican-controlled Legislature and was expected to be at the center of battles between Democratic Gov. Tony Evers and GOP lawmakers.

Both Neubauer and Hagedorn are appeals court judges and partisan interests played heavy in the race.

Former Democratic U.S. Attorney General Eric Holder’s group committed to spending $350,000 to help Neubauer win. A host of conservative groups, including Americans for Prosperity that is part of the Koch network, matched Democratic outside spending to help Hagedorn.

Hagedorn, an evangelical Christian, spent much of the race defending his conservative beliefs. Opponents have pointed to a blog he wrote as a law school student in the mid-2000s in which he called Planned Parenthood a “wicked organization” and denounced court rulings favoring gay rights by likening homosexuality to bestiality. They have also pointed to his founding of a conservative private school that allows for expelling students who are gay. Hagedorn was also paid $3,000 to give speeches at meetings of the Alliance Defending Freedom, a group that supported criminalizing sodomy and sterilizing transgender people.

Neubauer, 61, was appointed to the appeals court in 2007 by former Democratic Gov. Jim Doyle. Neubauer was elected to the appeals court in 2008, re-elected in 2014 and has been chief judge since 2015. She spent almost 20 years as an attorney in private practice. Nearly every judge who endorsed a candidate in the race — more than 340, or 98% — backs Neubauer. Hagedorn won endorsements from the National Rifle Association and Wisconsin Right to Life.

The winner will serve a 10-year term and replace retiring liberal Justice Shirley Abrahamson, who is 85.