Canadian Prime Minister Justin Trudeau acknowledged Wednesday night that a photo TIME magazine published of him wearing brownface at an "Arabian Nights" party in 2001 was racist, as he apologized for his actions.

Why it matters: Trudeau, who has celebrated Canada's diversity throughout his tenure as prime minister, recently triggered a general election scheduled for Oct. 21. It will effectively be a referendum on Trudeau's first term, Axios' Dave Lawler notes.

An ethics scandal and unfulfilled expectations mean it's far from certain he'll win a new term. Polls show his Liberals neck and neck with the opposition Conservatives.

What he's saying: While taking reporters' questions, Trudeau repeatedly said he's "pissed off" at himself and sorry to Canadians.

I dressed up in an Aladdin costume and put makeup on. I shouldn’t have done it. I should have known better, but I didn’t and I’m really sorry."

— Canadian Prime Minister Trudeau's comments to reporters

When asked if it was the only time he'd done something like this, Trudeau responded: "When I was in High School I dressed up at a talent show and sang "Day O" with makeup on."

he'd done something like this, Trudeau responded: "When I was in High School I dressed up at a talent show and sang "Day O" with makeup on." "Day O" is a song by Harry Belafonte.

When asked if the photo was racist , Trudeau responded: "Yes."

, Trudeau responded: "Yes." He added that he "didn't consider it a racist action at the time," but has since realized he was wrong.

The big picture: The photo that Time published earlier Wednesday taken at the Arabian Nights gala appeared in the school's yearbook. Trudeau was 29 at the time and a teacher at the private school where the event was being held. The now-prime minister can be seen wearing a turban, robes and makeup to darken his skin.

The school, West Point Grey Academy, ranges in tuition from $22,000 to $23,000 annually — making it one of the "most expensive private day schools in Vancouver," according to TIME. During his first campaign, Trudeau played down his role at the school, opting instead to tout his time teaching at a public school.

While the photo was previously unreported, TIME notes it has been the "subject of gossip within the West Point Grey community."

Go deeper: The Gridiron Club's blackface past

Editor's note: This article has been updated with Canadian Prime Minister Justin Trudeau's comments