WHEN the Liberal Party came third in Canada’s 2011 general election, with just 34 of the 308 seats in the House of Commons, pundits began to talk of the impending death of what for more than a century had been the country’s natural party of government. The Liberals had been led to the brink of oblivion by a run of disastrous leaders, effortlessly outwitted by Stephen Harper, the Conservative prime minister since 2006.

Now such talk seems premature. Four by-elections late last month bore out the Liberals’ recent lead in opinion polls. No seats changed hands: the Liberals and Conservatives each held two. But the Liberals saw their support surge across the board, at the expense of both the Conservatives and the leftish New Democratic Party (NDP), the official opposition. It was the strongest indication yet that the party had picked a potential winner last April when Justin Trudeau, the son of a former prime minister, was chosen as its leader.

This optimism could yet prove to be as transient as it was when Michael Ignatieff, an academic and journalist, took over the party in 2008 only to lead it to its worst showing in history in 2011, losing his own seat. Yet Mr Trudeau enjoys advantages that his predecessors lacked, both personally and in the timing of his arrival in national politics.

Start with the surname. Born in 1971 when his father, Pierre Trudeau was prime minister, Justin Trudeau grew up in the public eye. He was already a celebrity when he won a Montreal seat in 2008. In the early months of his leadership there have been echoes of the Trudeaumania that surrounded his father. Yet even he was a divisive figure compared with the conciliatory son. “I haven’t seen a Canadian political leader in almost my lifetime get this much popular interest,” says Darrell Bricker, an experienced pollster.

Before entering politics, Mr Trudeau was a secondary-school teacher in the western province of British Columbia. The Conservatives cannot dismiss him as “just visiting”, their devastating put-down of Mr Ignatieff, who spent most of his adult life outside Canada. Nor can they portray him as a hapless egghead, as they did Mr Ignatieff’s predecessor, Stéphane Dion, a former university professor.

Mr Trudeau has a habit of making gaffes. For example, he said that he admired China’s dictatorial leadership for its ability to implement environmental policies, and suggested the bombers of the Boston marathon felt “excluded”. Nevertheless, his tendency to talk off the top of his head works in his favour at times, says Roger Gibbins of the Canada West Foundation, a think-tank. “Part of his appeal is he is a leader who speaks his own mind.”

He has also emerged at the right time. After almost eight years Mr Harper and his government are looking tired. Both Conservative backbenchers and the public are growing restless. The prime minister has been bogged down for months in the House of Commons answering questions about his office’s involvement in covering up a Senate expenses scandal. For the first time since 2006 there is serious talk about a possible successor to the Tory leader.

This has given Mr Trudeau breathing space to put a team and a platform in place for the next election, due in 2015. The Liberals’ fund-raising has improved, although the Conservatives are still pulling in more money than their opponents. Helped by his own ties to the region, the Liberals have worked to get strong candidates adopted in western Canada, a wasteland for them since Mr Trudeau’s father implemented an unpopular energy plan of which the memory is now fading.

Though dismissed by some as a lightweight, Mr Trudeau has taken some policy positions. He is for the Keystone XL pipeline, planned to take oil from Alberta’s tar sands to the Gulf of Mexico, because he supports trade. But he also wants a tax on carbon. He backed the controversial takeover by a Chinese company of Nexen, an oil firm, because Canada needs more foreign direct investment. He opposed Quebec’s plan to bar civil servants from wearing religious symbols because it is divisive. Crossing the partisan divide, he has praised Mr Harper’s negotiation of a free-trade deal with the European Union. And he thinks marijuana should be legalised.

None of this means that the Liberals are a shoo-in for 2015. Their position in the centre makes their poll lead vulnerable to attacks from both the Conservatives and the NDP. Mr Harper has shown that he is at his most ruthlessly effective when cornered. But if nothing else, Mr Trudeau has brought the Liberals firmly back into the political game.