Appeals Judge Brian Hagedorn claimed victory Wednesday in the race for a Wisconsin Supreme Court seat that has come down to the wire.

With over 1.2 million votes cast, Hagedorn, who was backed by conservatives, leads Appeals Judge Lisa Neubauer by 50.2 percent to 49.8 percent, a margin of 5,500 votes. The margin is close enough that both campaigns are preparing for a recount. According to Wisconsin law, a recount can occur if the margin between candidates is less than one percent.

Hagedorn released a statement on Twitter where he claimed victory and called his lead "insurmountable."

"The people of Wisconsin have spoken, and our margin of victory is insurmountable," Hagedorn said in the statement. "And I thank everyone who supported us along the way. This was a true grassroots campaign fueled from the bottom up."

If there is a recount and Hagedorn prevails, he will replace liberal Justice Shirley Abrahamson, who disclosed she had cancer last year. The race has significant repercussions for the state because it ensures a conservative majority on the court until 2023 and will decide on cases like gerrymandering and former Gov. Scott Walker's (R.) controversial government reforms.

Liberal groups like Greater Wisconsin Committee, Planned Parenthood Advocates of Wisconsin, and former Attorney General under President Barack Obama, Eric Holder's national group the National Democratic Redistricting Committee poured money into the race on Neubauer's behalf. Conservative groups who usually are involved in the state's Supreme Court races, like the U.S. Chamber of Commerce, stayed out of the race.

In the final weeks of the campaign, liberals launched attacks against Hagedorn for his social conservative views. He wrote against the courts striking down an anti-sodomy law in a blog post, citing that it would lead to bestiality. He also faced attacks for being a founder of a private school that disallowed students and teachers who are in gay relationships.

The Republican State Leadership Committee (RSLC) got involved in the race and released an ad defending Hagedorn from the attacks.

"Wisconsin voters knew what was at stake in last night's election: a choice between a liberal, activist judge who would legislate from the bench or a conservative, rule of law judge committed to interpreting the state Constitution as written," RSLC president Matt Walter said in a statement. "We have seen the Democrat socialists, led by Barack Obama and Eric Holder, try to take over state Supreme Courts in an effort to end-run the authority of state legislatures by electing activist judges to what should be the government’s most restrained branch. In Wisconsin, we identified a path to victory and invested accordingly to thwart the advancement of the radical drumbeat of socialism that has hijacked the Democrat party."

Next week, local officials will begin to tally the votes to determine the official margin, which will decide if a recount is able to occur.