Mr. Barrett, the mayor of Milwaukee since 2004, easily won the Democratic primary Tuesday and will take on Mr. Walker in the June 5 recall a short four weeks away. Mr. Walker defeated Mr. Barrett by 125,000 votes, or 5 percentage points, in 2010 as part of a GOP sweep into power that also saw Republicans take the Legislature and knock off Democratic U.S. Sen. Russ Feingold.

The recall drive was sparked when Mr. Walker and Republicans passed a law that effectively ended collective bargaining rights for most public workers and forced them to pay more for health insurance and pension benefits. Mr. Walker contends the moves were necessary to help balance a state budget shortfall of $3.6 billion.

He’s trying to frame the recall as a question of whether Wisconsin wants to go back to what he calls failed policies of Democrats or to continue moving forward under his reforms. Mr. Barrett and his fellow Democrats are presenting it as a referendum on Mr. Walker and his policies.

While the union fight spurred the recall, the campaign has been much broader and focused largely on Wisconsin’s economy. Though the state’s unemployment rate is at its lowest level since 2008, Wisconsin lost more jobs than any other state between March 2011 and March 2012. Since Mr. Walker took office, only 5,900 private-sector jobs have been created.

“Our view is Scott Walker has done a lot of damage to the state, and Wisconsin can’t be fixed as long as Scott Walker is governor,” Mr. Barrett told the Associated Press.

Mr. Walker‘s union rights measure blindsided his opponents, who proceeded to pack the state Capitol by the thousands for weeks of protest as Democratic lawmakers fled the state in an ultimately unsuccessful effort to block the newly minted governor’s plans.

After the measure passed, Mr. Walker‘s opponents began targeting Republicans for recalls. Two of nine senators who faced recalls last year lost. Mr. Walker and five other Republicans face recall elections this year, with Mr. Walker hoping to avoid becoming the third governor in U.S. history to be recalled from office.

“It should never have come to this crap,” said Carl Schramm, 77, a Whitefish Bay man who works part time for a plumbing and heating contractor and who voted for Mr. Walker against token opposition in the GOP recall primary. “It’s stupid. It costs a lot of money. He was duly elected.”

Jon Dzurak, a 55-year-old assistant principal in Milwaukee, said he initially was leaning toward Democrat Kathleen Falk but decided to vote for Mr. Barrett because he was up in the polls and projected to fare better against Mr. Walker.

“I just would like to see Scott Walker defeated. I’ve never seen a division in our state like this. I’m not talking to some of my friends right now because of it,” he said.

Mr. Barrett won the Democratic primary even though he wasn’t the favored candidate of the very unions that spurred the fight and helped organize the drive to collect more than 900,000 signatures to trigger the election.