Andrew Scheer had only one path that would take him to the leadership of the Conservative Party. On Saturday night, the Saskatchewan MP took it — beating front-runner Maxime Bernier by the narrowest of margins on the 13th and final ballot.

Scheer can chalk up his unexpected win to two factors: a strong showing by social conservatives and a poor one from Bernier in his home province of Quebec.

Andrew Scheer’s victory speech to Conservatives17:10

Scheer trailed the MP in Beauce riding throughout the count, surpassing him only on the final ballot to win with 50.95 per cent of the 33,800 points available, points spread evenly over Canada's 338 ridings. Bernier took the remaining 49.05 per cent.

The points system had been a condition of the merger of the Canadian Alliance and Progressive Conservatives in 2003, in order to prevent the weaker PCs from being swamped by the Canadian Alliance and its huge list of members in Western Canada.

Andrew Scheer wins Conservative leadership race1:25

But the results suggest that there were no regional cleavages in this tight vote.

Scheer won the most points in British Columbia, Saskatchewan, Ontario and Atlantic Canada, while Bernier won in Alberta, Manitoba and Quebec — resulting in the unlikely situation of both Alberta and Quebec getting the Conservative leader they did not support.

Bernier underperforms in Quebec

A dominant performance in Quebec would have been key to a Bernier victory. Scheer had the greater potential for growth from ballot to ballot in the rest of the country, and Bernier needed a big number in his home province to hold off the challenge.

Instead, the candidate who raised funds from roughly half of all donors in Quebec and who led by a wide margin in the polls in the province took just 39.4 per cent of the points — less than 12 percentage points ahead of Scheer. By the final ballot, Bernier had 55.6 per cent of the 7,800 points in Quebec.

The metrics suggested he had the potential for much more than that. Instead, Bernier lost his own riding of Beauce by a margin of 51 to 49 per cent, as Scheer overshot expectations in Quebec by a significant margin.

bernier

Bernier opposes supply management, which put him at odds with farmers in his home province of Quebec. Scheer matched Bernier for votes in Bernier's own riding of Beauce. (Mark Blinch/Reuters)

Trost, Lemieux voters tip the balance

The signs that the result was going to be razor thin emerged on the first ballot. Bernier's target for having a reasonable expectation of victory was at least 30 per cent. He instead finished with 28.9 per cent, suggesting that the final result would come down to the wire.

Scheer's 21.8 per cent share of the points beat expectations — particularly at the expense of Erin O'Toole, who at 10.7 per cent of the points on the first ballot was below his target. But Scheer's high number alone might not have been enough. Instead, it was the strong results for fellow social conservatives Brad Trost and Pierre Lemieux that helped deliver victory.

In fourth place, Trost finished unexpectedly high on the first ballot with 8.4 per cent of the points. Combined with Lemieux, the two social conservatives had 15.7 per cent of the points.

Conservative Leadership 20170526

Brad Trost, who ran for the leadership as an avowed social conservative, finished a surprising fourth in the balloting at the convention in Toronto. (Nathan Denette/Canadian Press)

The social conservative vote, however, did not grow much from there. On the last ballot when both Lemieux and Trost were present, their share of the points had increased marginally to just 16.2 per cent. But they went over to Scheer in such large numbers that they played an important role in his victory.

Bernier maintained a lead of about seven to eight points as candidates were eliminated — until Lemieux dropped off the ballot. The gap between Bernier and Scheer closed significantly as Scheer took about 28 per cent of Lemieux's points to just six per cent for Bernier (Trost took the lion's share).

Peter Mansbridge speaks with Andrew Scheer7:44

The margin between the two candidates dropped again when Trost was subsequently eliminated and Scheer gained 57 per cent of Trost's points to just 27 per cent for Bernier.

O'Toole delivers final blow

Buoyed by these social conservative voters, Scheer closed the gap to just two points of Bernier on the penultimate ballot. The final decision would come to O'Toole's supporters and those he had gained through the preferential ballot — including a large proportion of Lisa Raitt's and Michael Chong's voters.

Scheer won 59 per cent of O'Toole's points, giving him just enough to inch ahead of Bernier.

That Scheer prevailed among voters who had backed O'Toole, Chong and Raitt, along with the supporters of Lemieux and Trost, suggests that Scheer was able to bridge the divide between the two traditional wings of the party.

But it was a near-run thing. With just a slightly better performance in Quebec, Bernier would be the new leader of the Conservative Party today. Taking just a few more of O'Toole's voters would have also flipped the result, or not splitting the supporters of Kellie Leitch with Scheer.

In the end, the ballot-to-ballot results eked out the slimmest of victories for Scheer — the only kind he had a hope of winning.