Nine years ago, Kathleen Wynne was a social activist-turned school trustee who handily knocked off a sitting cabinet minister to earn a seat in the Ontario legislature. On Saturday evening, she made history on two fronts: as the first woman chosen to lead Ontario's government and the first openly gay premier in the nation's history.

After three rounds of voting, she stormed past Sandra Pupatello at the Ontario Liberal leadership convention in Toronto's Maple Leaf Gardens, defeating her chief rival 1,150 to 866 to succeed Dalton McGuinty.

When the results were announced, she joined hands with Ms. Pupatello and raised them in the air, as her supporters' cheers swelled to a deafening roar.

Story continues below advertisement

"Believe it or not, this was the easy part," Ms. Wynne said, acknowledging the troubles the government faces in navigating a minority parliament, reaching labour peace with teachers and dealing with an $11.9-billion deficit.

In a display of unity, she called all the other leadership candidates, and then Liberal caucus members on to the stage.

"Thank you Sandra for your energy, for your passion, for your dedication to the party. I'm going to need you," she said. At the end, she called up Mr. McGuinty, who clasped her hand.

In her concession speech, Ms. Pupatello was equally gracious: "Tonight, we made history – our final ballot had two women on it," she said. "From the beginning, we had the boys on the run."

Ms. Pupatello, a former cabinet minister from Windsor, Ont., was seen as the choice of the party's establishment and led on the first two ballots. The turning point came after the second round of voting, when candidates Charles Sousa and Gerard Kennedy came over to Ms. Wynne's camp.

Ms. Wynne met with Mr. Sousa in an arena bathroom to hammer out a deal. Originally, he and Mr. Kennedy planned to cross over to Ms. Wynne together.

But Mr. Kennedy led his supporters out of the stands and into a nearby hallway to discuss his decision with them. They were still talking when Mr. Sousa and his entourage crossed the convention floor to Ms. Wynne's side. After some 20 minutes, Mr. Kennedy emerged as well and, surrounded by a crush of supporters, made his way over to Ms. Wynne. As he climbed the stairs leading to her balcony, Ms. Wynne stepped out to meet him.

Story continues below advertisement

The pair joined with Mr. Sousa and Eric Hoskins, the last-place finisher on the first ballot, who moved to support Ms. Wynne. The four stood on Ms. Wynne's balcony, waving to a mass of ecstatic supporters below.

A policy wonk with a laid-back, likeable persona, Ms. Wynne successfully pitched herself as a woman ready to govern, promising to bring the legislature back next month and push forward the party's agenda by working with the opposition.

Despite concerns she was too low-key to fight her way to victory, Ms. Wynne turned in a formidable performance at the convention, with a raucous entrance that saw her supporters dancing on-stage, followed by a speech that combined personal anecdotes with partisan rhetoric.

She also addressed, head-on, the worry some Liberals had expressed that an openly-gay candidate could not win a general election. She pointed out that the other candidates – a Portuguese-Canadian, an Indo-Canadian, a Catholic and a woman – would once have been thought unelectable.

"I don't believe the people of Ontario judge their leaders on the basis of race, colour or sexual orientation," she said to loud cheers from her supporters. "I don't believe they hold that prejudice in their hearts."

There had been debate in Ms. Wynne's camp over whether the topic should be in her speech, but campaign insiders say she insisted on including it.

Story continues below advertisement

It was fitting that Ms. Wynne's victory came in large part because of her conciliatory style.

Born and raised in Richmond Hill, Ont., a city north of Toronto, the 59-year-old made her career as a professional mediator. She got into politics by way of activism, joining one group opposing the merger of several municipalities into a single city of Toronto and another advocating for better public education during the 1990s cutbacks of then-premier Mike Harris.

Elected a school trustee in 2000, she went to Queen's Park in 2003 after unseating Tory minister David Turnbull. That same election was the one that brought Mr. McGuinty to power, and Ms. Wynne's star rose quickly. She became education minister in 2006, working on the government's signature full-day kindergarten program. Ms. Wynne later served in the transportation and municipal affairs portfolios.

Ms. Pupatello and Ms. Wynne emerged as the front runners early in the race. But Ms. Pupatello's insistence on getting a seat before recalling the legislature put her at odds with many of her rivals. She retired from provincial politics in 2011 after 16 years as an MPP. Other contenders were anxious to re-open the legislature, which has been prorogued since mid-October.

The fact that Ms. Wynne has a seat in the legislature, and her policies focusing on eliminating the deficit while leaving nobody behind, played a role in the third and fourth place finishers endorsing her.

"I'm trying to send a signal that we want to get the house back as soon as possible," Mr. Sousa told reporters. "We're in a minority situation. I believe the public is looking for leadership on that score."

Story continues below advertisement

Mr. Kennedy told reporters that Ms. Wynne's desire to help the vulnerable and restore labour peace with the province's teachers resonated with him.

"I was trying to win right up to half an hour before the [second ballot] vote was announced," he said. "I realized that my path was pretty much in jeopardy."

Mr. Kennedy, a former MPP and cabinet minister, said he has not yet decided whether to run in the next election, at which point Ms. Wynne leaned over and said, "if you want to know whether we have a spot in cabinet, yeah we do."

She said she is delighted with the endorsements of three of her rivals, including Eric Hoskins.

"We're going to form a great government," she said.

Ms. Pupatello won the support of 39.4 per cent of delegates on the second ballot, giving her a three percentage point lead over Ms. Wynne.

Story continues below advertisement

Ms. Pupatello picked up an additional 218 votes, leaving her with 817. Ms. Wynne added another 153, bringing her tally to 750.

Mr. Kennedy trailed a distant third with 281 votes, Mr. Sousa with 203 and Harinder Takhar, who pledged his support to Ms. Pupatello after the first ballot, took just 18.

The two front runners each picked up the support of a lower-placed candidate minutes after finishing a hair's breadth apart in the first round of voting.

Results of the first ballot had Ms. Pupatello with 599 votes, just two ahead of Ms. Wynne, with 597.

As soon as the first ballot results were announced, supporters of the remaining candidates began chanting "We want Eric!" Mr. Hoskins and advisors huddled in his booth, as delegates gathered on the convention floor below, shouting his name.

Health Minister Deb Matthews, one of Ms. Wynne's campaign co-chairs, was spotted in his booth. Shortly after, former premier David Peterson, standing near Mr. Hoskins, turned to give Ms. Wynne what appeared to be a thumbs-up. Mr. Hoskins, however, kept everyone guessing by walking halfway across the convention floor before turning around and leading his delegates to Ms. Wynne. She walked halfway down the staircase leading to her booth and the pair embraced.

Story continues below advertisement

Just minutes later, Mr. Takhar took everyone by surprise by crossing over to Ms. Pupatello, even after his own staff insisted he wasn't going anywhere. His change of mind came too late to remove his name from the second ballot.

Party insiders said Mr. Takhar's sudden move was motivated by Ms. Wynne's "momentum changing" speech. Many speculated that he had cut a deal with Ms. Pupatello, who was anxious to regain a wider lead over her chief rival.

"People have their own motivations," said one of Ms. Wynne's supporters.

Ms. Pupatello denied to reporters that she offered anything to Mr. Takhar in return for his support.

Mr. Takhar, for his part, said it was Ms. Pupatello's focus on jobs and the economy that lead him to endorse her.

The convention's more than 2,000 delegates are made up mostly of representatives elected by party members in each of the province's 107 ridings, plus 419 party brass.

Outside, thousands of protesters, most of them teachers and public-sector union members, protested Mr. McGuinty's move to impose contracts on teachers earlier this month.

And after Ms. Wynne's victory, the opposition was quick to warn that the road ahead would be difficult.

In a statement, PC leader Tim Hudak said he looked forward to meeting with Ms. Wynne on Monday to discuss eliminating the province's deficit.

New Democratic Party Leader Andrea Horwath said in a statement she looks forward to Ms. Wynne recalling the legislature without delay.

"Now, more than ever it's time to roll up our sleeves and get to work on the challenges facing Ontario families," she said.

Editor's note: Kathleen Wynne was born and raised in Richmond Hill. An earlier version of this article incorrectly said she is from Newmarket, Ont. This version has been corrected.