MADISON, Wis. - Wisconsin Gov. Scott Walker beat back a recall challenge Tuesday, winning both the right to finish his term and a voter endorsement of his strategy to curb state spending, which included the explosive measure that eliminated union rights for most public workers.

The rising Republican star becomes the first governor in U.S. history to survive a recall attempt by defeating Milwaukee Mayor Tom Barrett and the union leaders who rallied for months against his agenda.

Democrats and organized labor spent millions to oust Walker, but found themselves hopelessly outspent by Republicans from across the country who donated record-setting sums to Walker. Republicans hope the victory carries over into November and that their get-out-the-vote effort can help Mitt Romney become the first GOP nominee to carry the state since Ronald Reagan in 1984.

The recall was a rematch of the 2010 governor's race. Throughout the campaign, Walker maintained his policies set the state on the right economic track. Defeat, he said, would keep other politicians from undertaking such bold moves in the future.

Barrett repeatedly accused Walker of neglecting the needs of the state in the interests of furthering his own political career by making Wisconsin "the tea party capital of the country." He said Walker had instigated a political civil war in Wisconsin that could be quelled only by a change in leadership.

"I will end this civil war," Barrett promised in a debate. "That is something the people of this state want."

Walker ascended into the national spotlight last year when he surprised the state and unveiled plans to plug a $3.6 billion budget shortfall in part by taking away the union rights of most public workers and requiring them to pay more for their health insurance and pension benefits. It was one of his first moves in office.

Democrats and labor leaders saw it as a political tactic designed to gut the power of his political opposition. State Senate Democrats left Wisconsin for three weeks in a sort of filibuster, as tens of thousands of teachers, state workers and others rallied at the Capitol in protest.

But the tea-party supported fiscal conservative remained steadfast: Walker believed his plan would help him control the state budget, and his opponents could not stop Republicans who control the state Legislature from approving his plans.

Walker went on to sign into law several other measures that fueled calls for a recall, including repealing a law giving discrimination victims more ways to sue for damages, making deep cuts to public schools and higher education, and requiring voters to show photo identification at the polls.

Both sides mobilized thousands of people and millions of dollars to influence voters, whom polls showed were more divided than ever. Signs calling for Walker's removal and those supporting the 44-year-old son of a minister dotted the state's landscape all spring at a time normally devoid of political contests.

Turnout was strong across the state with few problems reported as some voters waited in line to cast their ballots.

"Typically we wait until 5 in the afternoon, but we were chomping at the bit to just get it over and done with because I think it has been an unjust campaign waged against the governor," said Jeff Naunheim, a warranty analyst from St. Francis who voted for Walker first thing Tuesday.

"Even if it doesn't turn out the way we want it to, it proves a point," said Switzer, an occupational therapist and single mother on BadgerCare, the state's health insurance program for the working poor. "People in Wisconsin aren't just going to stand by and let a governor take over the state and cut social services."

More than $66 million was spent on the race as of May 21, making it easily the most expensive in Wisconsin history. That money was spent on an all-out barrage of television ads, direct mail, automated calls and other advertising that permeated the state for months.

Walker used the recall to raise millions from conservative donors and bolster his own political fame in the face of the fight. National GOP groups, including Americans for Prosperity and the Republican Governors Association, poured money into the contest.

Unions got behind the recall drive, which started with the collection of more than 900,000 signatures over two months to force the vote. Barrett defeated the union-favored candidate in the Democratic primary in May and then tried to use that to his advantage, while also courting union support. He pledged to call a special legislative session to restore the collective bargaining rights Walker took away.

Also Tuesday, Lt. Gov. Rebecca Kleefisch and three Republican state senators also faced recall elections, and a fourth open Senate seat was also to be filled. Democrats hoped to win at least one of the Senate seats, which would give them a majority at least through the end of the year.

The recall also focused as much on his record creating jobs as on the divisive union proposal. Walker promised in 2010 to create 250,000 jobs over four years as governor, and just how many jobs were created under Walker was a major point of contention. Walker relied on new data showing the state added about 23,000 jobs in 2011, while a different survey that Barrett favored found the state had lost about 34,000.

Walker expressed no remorse during the campaign, saying he was sticking with his convictions. "I'm not afraid to lose," he said during a May interview with The Associated Press. "I plan to win, I'm running to win, but I'm not afraid to lose to do the right thing."

But that doesn't mean the public will see a changed Walker after the recall.

"I still think people elected me before in November 2010 and they'll elect me again because they want me to fix things," Walker said in the interview. "They want me to keep the focus and attention on fixing things. We're just going to make sure we've got a more comprehensive and inclusive process to get there."