St. Clair County Circuit Judge Stephen McGlynn, Republican, has won election in a very close race against Associate Judge Heinz Rudolf, Democrat.
With all precincts reporting in St. Clair County, including totals from East St. Louis, McGlynn edged Rudolf 50.6 percent to 49.4 percent.
In St. Clair County, McGlynn won by a margin of 55 to 45 percent, receiving 37,300 votes to Rudolf's 30,478 votes.
In East St. Louis, Rudolf won by a margin of 94 to 6 percent, receiving 6,258 votes to McGlynn's 378 votes.
The seat McGlynn won was vacated by former judge Michael Cook who stepped down after he was arrested on heroin possession and weapons charges in May 2013. He pleaded guilty to charges and is serving a two year sentence in federal prison.
A Republican has not been elected judge in St. Clair County for several decades, some believe the last time it occurred was in the 1970s.
McGlynn said he was grateful for the support of voters.
He said that an "outrageous" attack on Illinois Supreme Court Justice Lloyd Karmeier launched about two weeks before the election might have helped his campaign.
"I believe that the attacks on Karmeier were so outrageous that it reminded people in the Metro East that they don't want to return to the days where a handful of powerful, wealthy lawyers feel like they can tell us who our judges are going to be and who they are not going to be," he said.
"It reminded people that this is a system in the Metro East that needs to be made independent of special interests."