Canadian Prime Minister Justin Trudeau says he "should have known better" than to wear brownface to a 2001 costume party.

Key points: The photo appears in the 2000-2001 yearbook of the West Point Grey Academy, where Mr Trudeau was a teacher

The photo appears in the 2000-2001 yearbook of the West Point Grey Academy, where Mr Trudeau was a teacher Mr Trudeau, the son of former Canadian PM Pierre Trudeau, was 29 years old at the time

Mr Trudeau, the son of former Canadian PM Pierre Trudeau, was 29 years old at the time The Canadian general election will be held on October 21

Mr Trudeau is currently campaigning to retain his job at next month's general election.

Time magazine posted the yearbook photo, which it said was published in the yearbook from the West Point Grey Academy, a private school in British Columbia where Mr Trudeau worked as a teacher before entering politics.

The photo depicted Mr Trudeau wearing a turban and robe, with dark makeup on his hands, face and neck.

Mr Trudeau told reporters today he regretted doing "something that I shouldn't have done".

"I take responsibility for my decision to do that. I shouldn't have done it. I should have known better," he said.

"It was something that I didn't think was racist at the time, but now I recognise it was something racist to do."

Liberal Party spokesman Cameron Ahmad confirmed the photo was of Mr Trudeau.

He said it was taken at the school's annual dinner which had an Arabian Nights theme that year.

Mr Trudeau was dressed as a character from Aladdin.

Last month, Mr Trudeau became the first Canadian prime minister found to have broken federal ethics rules, after a watchdog delivered a scathing inquiry into his attempts to prevent a corruption trial from going ahead.

Mr Trudeau, who swept to office in November 2015 promising "sunny ways" and stressing the importance of gender equality and the environment, is locked in a tight battle with Conservative leader Andrew Scheer ahead of the October 21 federal election.

Mr Scheer said he was "extremely shocked and disappointed" by the photo.

"Wearing brownface is an act of open mockery and racism. What Canadians saw this evening is someone with a complete lack of judgment and integrity and someone who's not fit to govern this country," he said.