The photograph had been taken when Trudeau, then a 29-year-old teacher, attended an “Arabian Nights” themed costume gala at the West Point Grey Academy in Vancouver, according to Time magazine, which published the image.

A spokeswoman for Trudeau’s reelection campaign confirmed that the photo was him.

“He attended with friends and colleagues dressed as a character from Aladdin,” the spokeswoman, Zita Astravas, said.

The photograph appeared in the school’s 2000-2001 yearbook, The View, Time said, adding that it had obtained a copy of the yearbook from a Vancouver businessman, Michael Adamson, a member of the school community. The magazine reported that Adamson, who first saw the photograph in July, felt that it should be made public.

The news immediately injected new uncertainty into the political career of Trudeau, the Liberal Party leader who began his reelection campaign a week ago. He has sought to cast himself as a champion of Canada’s racial and ethnic minorities in his nearly four years as prime minister.

The image also drew comparisons to the scandal that enmeshed Gov Ralph Northam of Virginia this year when a photograph surfaced that had been published in a medical school yearbook about 35 years earlier.

Prime Minister Justin Trudeau of Canada in his offices on Parliament Hill in Ottawa/Reuters

Initially, Northam apologized for appearing in the yearbook photo, which shows a man in blackface makeup standing next to someone wearing a Klan robe and hood. But he later insisted that he was actually not either of the people in the picture.

The photo of Trudeau quickly became the dominant topic on Canadian news websites.

Many Canadians are of South Asian and Middle Eastern descent and Trudeau has four Sikhs in his Cabinet. Many of those communities have been an important source of support for the Liberals and Trudeau.

But on a disastrous state trip to India earlier in the year, Trudeau attracted ridicule for wearing flashy silk and gold-embroidered outfits and pointed, red silk shoes. Though intended as a gesture of respect for Indian culture, it was widely seen in Canada as a cringe-inducing game of dress-up.

Last year, Trudeau was accused of groping a reporter in 2000 while he was still a private citizen. Trudeau rejected the allegation and it largely became forgotten.

On Wednesday, Jagmeet Singh, the leader of the New Democratic Party, who is a Sikh, said Trudeau’s costume was “insulting” and suggested, along with the groping allegations, that Trudeau may not be the same person in private as he portrays himself in public.

“Who is the real Mr Trudeau? Is it the one behind closed doors, the one when the cameras are turned off that no one sees?” Singh told reporters. “Is that the real Mr Trudeau? Because more and more, it seems like it is.”

Mustafa Farooq, the executive director of the National Council of Canadian Muslims, said that he found the photograph “deeply saddening” and called for the prime minister to apologise.

“The wearing of blackface/brownface is reprehensible, and harkens back to a history of racism and an Orientalist mythology, which is unacceptable,” Farooq said in a statement.

Political analysts noted that for Trudeau, a prime minister of the Instagram age, who had meticulously constructed a global image as a progressive on issues such as gender equality, indigenous and minority rights, the image of him in brownface could be politically damaging.

“It could repel some progressive voters who are against any kind of cultural appropriation and especially blackface,” said Jean-François Daoust, an expert in public opinion at McGill University. “It can undermine the aura he has tried to create.”

But Daoust added that it was important not to overstate the effects of an event that happened 18 years ago. He noted that the Conservative leader, Andrew Scheer, was also being taken to task for past behaviour, including comments he made in 2005 that same-sex couples should not be equally entitled to wed because marriage was meant for “natural procreation.”

Barry Kay, a political-science professor at Wilfrid Laurier University in Waterloo, Ontario, said the revelation was embarrassing and potentially damaging for Trudeau, but cautioned that it was too early to determine the effect it would have on the campaign. He said the image could reinforce existing impressions of Trudeau as inauthentic.

“I am not sure the extent that it will resonate in public opinion in a campaign where everyone has been turning on everyone,” Kay said.

The publication of the photo comes amid an acrimonious debate about multiculturalism in Quebec, an electorally vital province, which recently passed a law banning public-sector teachers, judges and police officers from wearing religious symbols at work. Trudeau, whose pro-immigration stance has been a cornerstone of his premiership, has condemned the law, which he has characterised as antithetical to Canadian values.

Trudeau, who is a member of parliament for Papineau, a multicultural area in Montreal, has been popular with immigrants who have lauded his pro-immigrant stance, including taking in 25,000 Syrian refugees. Analysts said it remained to be seen whether the photograph could alienate some minority voters in key urban areas like Toronto, which have large immigrant communities or whether it would be dismissed as an unfortunate indiscretion.

The issue of cultural appropriation reverberated in Canada in July 2018 when a show “Slav,” by the acclaimed Quebec theatre director Robert Lepage, premiered at the Montreal International Jazz Festival. The show, which featured white actors playing slaves, immediately spawned a backlash and criticism that white artists had recklessly appropriated black culture. Only two of seven cast members were black. The show was cancelled after two performances.

©2019 The New York Times Company