JAGMEET SINGH could have done many things when a heckler accused him at a rally last month of plotting to subject Canada to sharia law. The turbaned politician could have pointed out that he is a Sikh, not a Muslim. He could have skewered her with lawyerly wit (he is a criminal lawyer) or asked security guards to remove her. Instead he told the heckler that everyone loved her and led a chant of “Love and courage”. She eventually walked out.

A video of the encounter went viral and helped Mr Singh, a member of the Ontario legislature, win the leadership of Canada’s left-leaning New Democratic Party (NDP) on October 1st. He is the first member of a “visible minority” to lead a party at federal level. Canada’s Liberal prime minister, Justin Trudeau, congratulated his new rival on his “barrier-breaking win”.

Mr Singh faces a difficult task. The NDP lost the election in 2015 in humiliating fashion after throwing away an early lead in the opinion polls. Although it was the main opposition party before that vote, it has fallen to third in the House of Commons, with just 44 of the 338 seats. The Conservatives, now the official opposition, have more than twice as many. Mr Singh must pull his party back from the brink of irrelevance.

His background could help. A “hipster Sikh”, with a penchant for striking turbans, Mr Singh embodies the diversity that Mr Trudeau constantly celebrates. Like the prime minister, he is adept at social media and single-combat sports. (He practises Brazilian ju-jitsu; Mr Trudeau is a boxer.)

Sikhs have made more headway in politics than most minority groups. Mr Trudeau’s cabinet includes four. Erin Tolley, a scholar at the University of Toronto, offers several explanations for that. Sikhism emphasises the value of public service. Sikhs have a tradition, born in India, of mobilising to defend their rights. Most Sikhs come from well-educated immigrant families. There are currently 17 Sikh MPs.

Yet Mr Singh’s biography could also hurt him. A poll published in April showed that only 38% of Canadians have a favourable impression of Sikhism (33% view Islam favourably). Small but troubling anti-immigrant rallies have taken place over the past year, the latest in Ottawa on September 30th. Mr Singh’s religion may prove a disadvantage for the NDP in Quebec, which elected 16 of the party’s MPs. The French-speaking province is hostile to overt religious symbols like the turban and the kirpan, a dagger worn by Sikh men.

Mr Singh hopes to win over Canadians with a political programme that includes reducing inequality, improving pay and working conditions for people in insecure jobs and reforming the first-past-the-post electoral system (a promise that Mr Trudeau made but then forgot about). He will begin his quest for power by giving up his provincial seat and trying to win one in the House of Commons. The odds that he will one day become prime minister are slim. The NDP has governed provinces (it holds power in Alberta and British Columbia) but never the country. To wrest Mr Trudeau’s job from him at the next election in 2019, Mr Singh will have to break more than one barrier.