Wealthy businessman Bruce Rauner (R) has won a surprisingly close battle for the GOP primary to face Illinois Gov. Pat Quinn (D).

With 95 percent of precincts reporting, The Associated Press called the race with Rauner leading Illinois state Sen. Kirk Dillard (R) 40 percent to 37 percent. 

Rauner was thought to be the heavy favorite for the nomination — he'd outspent Dillard and two other GOP opponents by a wide margin and had double-digit leads in the few public polls of the race. He was a heavy enough favorite that Quinn released his first ad of the campaign on Tuesday — an attack ad against Rauner.

But it appears heavy spending by unions against the businessman, who supports pension changes they strongly oppose, may have hurt him. Unions combined to spend more than $3.5 million in the race.

Quinn has struggled in the polls throughout his tenure as governor. Illinois is Republicans' best chance at flipping a governor's mansion in their direction, and it's a top target for the GOP this fall.