TORONTO - Kathleen Wynne powered Ontario's minority Liberals past a legacy of scandal Thursday, staving off aggressive assaults from the Progressive Conservatives and New Democrats for an unexpected majority win and a fourth straight mandate.

Despite a hard-fought campaign rife with accusations of corruption and incompetence, jaundiced voters gave Wynne's government a fresh chance, making her the province's first elected female premier.

And in an election that was supposed to be Tim Hudak's to lose, they delivered a stinging rebuke to the Conservatives, robbing the party of 10 seats and forcing its leader to step down in defeat.

Defying almost all predictions, Wynne earned a convincing win both in the popular vote and the number of seats, paving the way for her party to govern on their own for the first time in three years — and she did it by moving to the left as her opponents moved in the opposite direction.

The ballot-counting began amid palpable uncertainty about whether the snap election, called more than a month ago, would change anything. Even the premier herself appeared taken aback at the magnitude of her win.

"Whoa! We did it!" a beaming, gleeful Wynne told cheering supporters in Toronto.

"You have put your trust in us and we will not let you down."

Wynne said she would ask the lieutenant-governor to reconvene the legislature within 20 days to reintroduce the very same Liberal budget that triggered the campaign when the NDP refused to support it.

Within an hour of the result becoming clear, Hudak — whose austerity platform of smaller government and public-sector job cuts ran smack into a voter brick wall — said he'd resign as leader as soon as a successor is chosen.

"We did not receive the results that we wanted," Hudak told dejected supporters at his headquarters in Grimsby, Ont.

"(But) nobody should take this result as an endorsement of the status quo."

Hudak said he would stay on as a member of the legislature and continue to represent his Niagara-area riding.

The Liberals easily beat the Tories in the popular vote amid a solid rejection of Hudak's pledge to slash 100,000 public-sector jobs as part of a shock deficit-tackling therapy.

They won 59 seats, Hudak's Conservatives took 27 and the New Democrats 21. At dissolution, the Liberals held 48 seats in the 107-seat legislature, the Tories 37 and the NDP 21, with one seat vacant.

At Liberal headquarters in Toronto, stony-faced tension gradually gave way to excitement and delight as it became clear that Wynne had taken the night. A burst of applause erupted when Hudak announced his resignation.

Speaking to a sparse crowd of about 200 supporters in Hamilton, Andrea Horwath — widely pilloried for her lurch to the right and seemingly nebulous campaign — said she would stay on to lead her third-place party.

"New Democrats are fighters and we're going to keep fighting for the things that matter most for families," said Horwath, who seemed close to tears.

Prime Minister Stephen Harper congratulated Wynne, saying he looked forward to working with her.

Millions of voters had spent Thursday casting judgment on the scandal-plagued minority Liberal government as Wynne, who became party leader 16 months ago, sought her first mandate.

As results tumbled in, it quickly became apparent that she had made her case for a renewed Liberal mandate by promising a fiscally responsible but progressive government.

Wynne spent much of the campaign staving off attacks related to decisions made by her predecessor Dalton McGuinty, which included the cancellation of two gas plants at an estimated cost to the public of $1.1 billion.

Both Hudak and Horwath were relentless in branding the Liberals as corrupt and incapable of fiscal responsibility, pointing to the province's $12.5-billion deficit.

Their campaigns, however, were anything but plain sailing.

Hudak ran into trouble with his pledge to create one million jobs — widely panned by economists as based on faulty math — and his promise to cut public-sector jobs at a time the provincial economy is sputtering.

Yet he persisted, positioning himself as the only plain-speaking leader ready to tell voters what they needed to hear, not what they wanted to hear.

The New Democrats, offering a grab-bag of pocketbook promises such as lower hydro rates and auto-insurance bills, appeared to throw Wynne a lifeline as Horwath tilted her party distinctly to the right.

It was Horwath who triggered the $90-million, 40-day campaign by refusing to support the minority Liberal budget many observers called the most progressive in the province's recent history.

As a result, Wynne fought back by arguing her party was the only option for voters worried a Hudak government would be a throwback to the days of former Tory premier Mike Harris, whose time in office in the mid- to late 1990s was marred by labour and education unrest.

She promised a provincial retirement savings plan along the lines of the Canada Pension Plan along with investments in education and transportation.

A vote for the NDP, Wynne insisted in the last week of the campaign, would be a vote for Hudak.

Horwath had scorned Wynne's overtures to NDP supporters, arguing voters didn't have to choose between the "corrupt" Liberals and the Tories' "crazy" platform.

The campaign grew more petulant as it wound down, with the leaders accusing their rivals of fearmongering and mudslinging while arguing they were presenting a positive message.

Unions, who had come out strongly against Hudak, welcomed the result.

"Ontario voters sent a clear message tonight that they want an Ontario with good jobs, strong public services and healthy communities," said Unifor president Jerry Dias.

"Ontario has clearly rejected Mr. Hudak's offer to race Ontario to the bottom."

The Ontario Federation of Labour echoed the sentiment.

"This should serve as a warning to the Progressive Conservative party that there is no appetite for emulating American Tea Party-style politics in this province," the OFL said in a statement.

Federal Liberal Leader Justin Trudeau congratulated Wynne on the breakthrough that puts her back in the premier's chair, this time with the blessing of voters, not just her party.

More than 9.2 million people were eligible to cast ballots but despite predictions of a low turnout, more than 50 per cent voted this time.

Also on HuffPost