In March 2012, Justin Trudeau, then simply the Liberal MP for Montreal’s Papineau constituency, agreed to take part in a televised boxing match to raise funds for a cancer charity. The pundits favoured his opponent, Patrick Brazeau, a Conservative senator with a scrapper’s build. But by the time the referee ended the fight, midway through the third round, it was Mr Trudeau, the privileged pretty boy, who was landing punches at will.

“Everyone assumed Trudeau would lose,” said Adam Radwanski, a columnist for Canada’s Globe and Mail newspaper. “But he’d trained hard. He looked like a guy who knew what he was doing.”

It’s a narrative that has repeated itself in this year’s Canadian general election. Now his party’s leader, Mr Trudeau entered the summer as the underdog: the Liberals languished in third place in the polls, while their frontman was written off as a political lightweight. But he has held his own during the leaders’ debates, looked at home on the campaign trail and, after results come in on Monday night, is expected to be Canada’s next Prime Minister.

A national poll by Nanos recently put Mr Trudeau’s Liberals at 37.1 per cent, ahead of the Conservatives led by incumbent Prime Minister Stephen Harper, at 29.4 per cent, with the left-wing New Democratic Party (NDP) trailing at 23.7 per cent. Whoever wins is likely to preside over a minority government.

To many this must look like destiny: Mr Trudeau, 43, is the eldest son of Pierre Trudeau, who served twice as Prime Minister for more than 15 years between 1968 and 1984. For much of his life, however, the son seemed more likely to take after his mother, Margaret, an author, actress and TV personality who hung out with the Rolling Stones, and had love affairs with Ted Kennedy and Jack Nicholson.

Born on Christmas Day 1971 and raised at the Canadian leaders’ residence, Mr Trudeau’s middle names are Pierre and James, after his father and his maternal grandfather, James Sinclair, once a Liberal cabinet minister. But rather than politics, Mr Trudeau’s first career was as a teacher, of maths and drama.

His father had a cerebral reputation, said Nelson Wiseman, a politics professor at the University of Toronto. “Pierre Trudeau studied at Harvard, he was an economic policy adviser in the Privy Council Office and a constitutional lawyer,” Professor Wiseman said. “Trudeau the younger doesn’t have that intellectual gravitas.” His name nonetheless made Mr Trudeau a public figure, particularly after a stirring eulogy at his father’s state funeral in September 2000. In 2007, he appeared in the series The Great War as Major Talbot Mercer Papineau, a Canadian killed at Passchendaele. A year later he was an MP.

The Liberals held power for 80 of the 110 years between 1896 and 2006. But their loss that year to the Conservatives led to infighting, and a more disastrous election in 2011, when they shrunk to become the third largest party.

Mr Trudeau was hesitant to run for the leadership. His parents had separated when he was six, their marriage destroyed in part by the demands of politics. “Nobody knows better than I do what the pressures of party leadership can do to a young family,” he said in 2012.

When he was elected party leader in April 2013, his celebrity sent the Liberals surging to the top of the polls. His momentum was only halted by Conservative ads, which cited Mr Trudeau’s past as a drama teacher as evidence he was not cut out for politics. Mr Harper and his colleagues referred to him, condescendingly, as simply “Justin”.

The Liberals were in third place when the election campaign began, but low expectations set by Mr Trudeau’s rivals worked in his favour. On the debate stage, Professor Wiseman said, “What kept Trudeau in good stead was his former occupation. He could perform!”

In the general election, the Trudeau name has been a mixed blessing: popular with urban liberals and immigrant communities, less so in the oil province of Alberta, where Pierre Trudeau is remembered for his controversial energy policy. Yet under Trudeau the younger, the Liberal party has modernised its electoral operation and attracted several star parliamentary candidates, including journalist Chrystia Freeland.