In the end, Justin Trudeau survived.
Canada’s prime minister and leader of its Liberal Party, who was once idolised as one of the last defenders of the global liberal order against a rising tide of nationalism and xenophobia around the world, emerged chastened but victorious from the country’s federal elections.
He will return to Ottawa as leader of a minority government after a gruelling campaign marred by scandals that have forever tarnished his brand and exposed deep divisions among the electorate but nevertheless delivered a resounding defeat to the country's fledgling far-right movement.
It hasn't been an easy year for Mr Trudeau. He was implicated in efforts to unduly pressure his attorney-general and highest-ranking indigenous official, Jody Wilson-Raybould, to settle a lawsuit against SNC-Lavalin, an engineering firm that was accused of offering bribes to corrupt officials in Muammar Qaddafi's Libya but which was a major employer in Quebec, a province crucial to the electoral prospects of the Liberals.
Footage of Mr Trudeau posing in "blackface" emerged a few weeks into the campaign. It was bewildering to watch the Canadian leader – whose moral stance and pledge to resettle Syrian refugees in Canada at a time when walls were rising and doors were closing all over the world earned him well-deserved accolades – parading as a racist caricature. It betrayed a profound lack of empathy and decency in his youth.
But his opponent, Conservative leader Andrew Scheer, failed to capitalise on the numerous missteps. He endured his own scandals, such as the revelation that he had hidden his dual-US citizenship, wasn’t truthful about his work history as an insurance broker and was accused of making offensive remarks towards certain groups. In the end, Canadian voters said no to the uninspired revanchism of the Conservatives, rather than a wholehearted yes to a lacklustre Mr Trudeau.
It was a shame, too, because the divisive rhetoric belied a more vibrant conversation in the grassroots about identity and systemic discrimination that preceded and followed the blackface scandal. Canadians prioritised climate change policies (of which the Conservatives had none). Half a million people demonstrated with climate activist Greta Thunberg in September, demanding climate action in Montreal in the city's largest-ever protest.
As a recent immigrant, it was refreshing to see what was possible while watching Jagmeet Singh, the first person of colour to run as leader of a federal party in a national election, handle racism and prejudice with grace and generosity. It is a lesson I will try to remember, even if his New Democratic Party (NDP) didn’t deliver on a rumoured late surge in support.
It was also a breath of fresh air to see the first attempt at Donald Trump-style nativist politics soundly defeated in Canada. Maxime Bernier, a former contender for the Conservative party’s leadership, founded the People’s Party of Canada. His welcome rhetoric on crony capitalism and the need to rein it in was drowned out by his party’s embrace of identity politics, rejection of what he called “extreme multiculturalism", demands for reducing immigration, and climate denialism.
Mr Bernier, the leader of his party, was defeated in his own electoral district. No members of the PPC were elected.
Mr Trudeau, on the other hand, will forge ahead as leader of a minority government. He has not signalled yet that he intends to form a coalition with either Singh’s NDP or the Bloc Quebecois, the resurgent francophone nationalist movement that has pledged not to seek independence for the province but will defend its interests and likely pose a hurdle to proposed oil pipelines through Quebec.
This resurgence of sovereignist politics in the East contrasts with an embattled oil-rich Alberta in the West. The province did not elect a single Liberal, leaving it with no voice in Mr Trudeau’s cabinet at a crucial moment in the debate on how best to tackle climate change and limit the extraction of fossil fuels. A major project, known as the Trans Mountain pipeline, to transport oil from Alberta to British Columbia that is owned by the Trudeau government remains stalled and has fuelled feelings of alienation there. Albertans insist that the pipeline is needed to prop up their oil industry but the indigenous First Nations peoples living in the region, as well as environmental groups, point out that it would increase pressure on the marine environment, with possible oil spills contaminating the waters and affecting fish stocks. Environmentalists in parties like the NDP and the Greens, as well as Mr Trudeau’s own Liberal caucus, are also against the pipeline. The prime minister may therefore end up having to ally with the Conservatives on pipeline legislation or with smaller parties to take real and effective action on climate change, indigenous rights and expanded health insurance programmes.
Indeed, Mr Trudeau's minority government and the divided electorate is an indication that Canadians want parties to work together but that they differ on what their priorities for Canada are and how to tackle them. Mr Trudeau will have to listen to those other voices.
He ultimately survived a difficult summer and an election campaign that has left Canadians divided on crucial, generational questions. Most Canadians voted against nativism and for tackling climate change. Mr Trudeau will have to govern with these priorities in mind while keeping the country together.
Voters decided to give the world’s liberal darling another chance at a legacy after the shock of the blackface scandal. It would be a shame to squander it with so much at stake.