CHICAGO -- Two Illinois Democrats were virtually tied early Wednesday in the race to decide who will defend the governor's office from a Republican Party eager to exploit political disarray in President Barack Obama's home state come November.

In the nation's first primary, voters selected the candidates who will fight for Obama's former Senate seat, but the governor's races were exceptionally tight on both sides. Though Gov. Pat Quinn declared victory in the Democratic race, challenger Dan Hynes vowed to fight until every vote was counted. About 5,000 votes separated the two.

"It was a close election, but one more than the other guy is a landslide in my book," Quinn said.

Hynes, the state comptroller, wasn't ready to concede. "Tonight we've learned one thing for sure: That is we are going to continue fighting," Hynes said. "If democracy means anything, it means we need to count all the votes. All the votes."

It initially appeared Quinn would easily win the Democratic nomination, but he faced a bruising primary while carrying the baggage of his two campaigns with disgraced Gov. Rod Blagojevich, his support for a major tax increase and a botched program that granted early release to some violent prison inmates.

The GOP hopes to win the governor's mansion after years of turmoil under Democrats, who were trying to distance themselves from Blagojevich after his ouster following allegations he tried to sell Obama's former seat. Both Democratic candidates also proposed income tax increases.

The Republican governor's race remained undecided with less than 1,500 votes separating the top two vote-getters, state Sens. Bill Brady of Bloomington and Kirk Dillard of Hinsdale.

Voters also set the stage for a November battle for the Senate seat Obama held before moving to the White House. Democrats nominated state Treasurer Alexi Giannoulias, a 33-year-old basketball buddy of the president, while Republicans picked five-term U.S. Rep. Mark Kirk.

Losing the seat in the increasingly Democratic-leaning state would be a bigger personal embarrassment for Obama than Republican Scott Brown's upset victory last month in Massachusetts, which took away the late Edward M. Kennedy's Senate seat.

Kirk is likely to question Giannoulias' experience and judgment while emphasizing Democratic troubles.

"We know that one political party cannot hold all the answers and that one political party should never hold all the power," Kirk said in a statement.

Giannoulias signaled he will go on the offensive.

"As we saw in Massachusetts, voters are angry," Giannoulias said. "For the past decade, Congressman Kirk has been a huge part of the problem."

The Blagojevich scandal could play a role in the Senate race as well. The incumbent, Roland Burris, chose not to run because the former governor had appointed him to the seat -- sullying his reputation so badly he could find little political support.

Obama, who cast an absentee ballot, tried to recruit some big-name Democrats, including popular Illinois Attorney General Lisa Madigan, but came up empty.

The Democrats who did get in the race had their own troubles. Giannoulias is carrying the baggage of his family bank and questions about a treasurer's office savings program that lost millions of dollars.

Republican leaders rallied around Kirk as their choice for the party nomination, despite complaints from some GOP activists that Kirk's support of gun control and abortion rights makes him too liberal.

With 879,704 votes counted in the Democratic gubernatorial race, only 5,382 votes separated Quinn and Hynes -- a margin of about one-half of 1 percent. But Quinn said the votes that remained to be counted were from Chicago precincts that support him.

"We know the precincts that are out. They're very good precincts for us," Quinn said.

The Hynes camp said tens of thousands of ballots -- including absentee ballots and provisional votes -- remained to be counted.

Also Tuesday, South Florida Democrats picked a state lawmaker to battle for the seat vacated by former U.S. Rep. Robert Wexler while the GOP special primary election appeared headed for a re-count. The winner will serve the last nine months of Wexler's term, then run for a full term in November. Wexler resigned in January to lead a Middle East think tank.