Howard Dean will finish far back in third, in a race that could spell the end of his presidential campaign.
With more nearly two-thirds of Wisconsin precincts reporting, Kerry held a 40 to 35 percent edge over Edwards, with Dean at 18 percent.
Close race or not, Kerry said, "A win is a win."
"We're winning in every state across the country," he said. "We're going to win the nomination."
Edwards, his dream of a head-to-head matchup now a reality, declared, "We'll go full-throttle to the next group of states."
Kerry has now won 15 of the 17 elections to date on the East and West coasts, in the Midwest, the Great Plains and the Southwest. He remains the undisputed front-runner.
But the Edwards surprise ended any hope for a quick conclusion to the race and earlier-than-ever general election planning.
Edwards pledged to campaign in each of the 10 states holding primaries or caucuses March 2, including California, New York and Ohio, and awarding 1,151 delegates, more than half the total needed to claim the nomination.
Edwards benefited from Wisconsin's open primary system. According to CBS News exit polls, 29 percent of the voters who went to the polls were independents, and they supported Edwards over Kerry by a 41-27 percent margin.
Edwards did even better among the 10 percent of primary voters who identified themselves as Republicans, besting Kerry by a 45-18 percent margin.
"It's obvious from the exit polling here in Wisconsin that I was much more appealing to independent voters and moderate Republicans, and we have to get these people to win the general election," Edwards told CBS News Anchor Dan Rather.
Kerry held a wide lead in pre-election polls, but the surveys did not fully reflect voter sentiments after a statewide debate Sunday, Edwards' criticism of Kerry's free-trade policies and two newspaper endorsements for Edwards. Nor did the polls take into account 11th-hour attacks on Kerry from President Bush's re-election team.
"We underwent a lot of Republican attacks the last week. Notwithstanding those attacks, we showed we can fight back," Kerry told the AP.
Dean was headed home to Vermont to figure out whether there was a future for the movement his candidacy once was.
Campaign aides offered conflicting reports about whether the former Vermont governor had decided to drop out of the race, would continue to the next big round of contests on March 2, or would suspend active campaigning without formally pulling out. Dean didn't clarify his intentions Tuesday, and no formal word was expected before Thursday.
"We are not done," he told supporters in a Madison ballroom.
Regardless of what decision ultimately is made, Dean's distant third-place finish Tuesday was a remarkable turnaround for a candidate who at the start of the year was thought poised to wrap up the nomination in the first handful of contests. He is winless in the 17 caucuses and primaries to date.