Canada's government plans to apologize to Canadians who have faced injustice because of their sexuality.

A special adviser to Prime Minister Justin Trudeau on LGBT issues said Wednesday that the government will acknowledge the role that legislation and policies played in the past discrimination.

Randy Boissonnault, MP Parliamentry Secretery, arrivea at the 2016 Canadian Screen Awards. George Pimentel / WireImage

Liberal Party lawmaker Randy Boissonnault said the government is "committed to apologize in an inclusive and meaningful manner before the end of 2017."

He made the announcement on the International Day Against Homophobia, Transphobia and Biphobia. A spokesman for the prime minister said Boissonnault will study potential follow-up steps, including the possibility of pardons and compensation.

Related: Alaska Lawmakers Deny Transgender Man Human Rights Post

Germany in March approved a bill that would annul the convictions of thousands of gay men under a law criminalizing homosexuality that was applied zealously in West Germany after World War II. In Britain, thousands of men convicted under now-abolished anti-homosexuality laws were pardoned posthumously in January.

Follow NBC Out on Twitter, Facebook and Instagram