OTTAWA -- The Liberal government is moving to repeal a law that courts and critics have long said unfairly criminalizes the sexual activities of gay and bisexual men -- part of broader efforts to turn the page on state-sanctioned discrimination based on sexual orientation and gender identity.

"Canadians expect their government and their laws to reflect their values," Justice Wilson-Raybould said Tuesday after tabling legislation to repeal a provision of the Criminal Code that places restrictions on anal intercourse.

Currently the sexual act is punishable by up to 10 years in prison. There is an exception for heterosexual married couples and consenting adults of either sex over age 18, as long as anal intercourse does not involve more than two people and is done in a private place without anyone watching.

Courts have found the provision to infringe on equality guarantees under the Charter of Rights and Freedoms, since 16- and 17-year-olds can consent to all other forms of sexual activity.

The proposed legislation known as Bill C-32 would repeal section 159 of the Criminal Code and prevent charges being laid against those 16 and older who engage in consensual anal intercourse, with the government noting that all non-consensual sexual activity would be covered under different, existing provisions.

"Our society has evolved over the past few decades and our criminal justice system needs to evolve as well," said Wilson-Raybould.

Egale Canada Human Rights Trust issued a report in June noting that while appeal court judges in five provinces -- as well as federal courts -- have ruled that section 159 is unconstitutional, police officers have continued to charge people under it.

In 2014-15 -- the most recent year for which data is available -- there were 69 charges under section 159 brought before adult courts, said Valerie Gervais, a spokeswoman for Wilson-Raybould.

None resulted in convictions, but Gervais said there were 98 charges in 2013-14 resulting in seven convictions.

New Democrat MP Randall Garrison, whose party has pushed for repeal of the provision, said his caucus would support the Liberals to get Bill C-32 passed as quickly as possible.

Conservative justice critic Rob Nicholson said he personally supports the proposed legislation because it is consistent with judicial decisions across Canada, and that his party would study it closely and "play a constructive role in the parliamentary debate."

The legislation came as Prime Minister Justin Trudeau named Liberal MP Randy Boissonnault his special adviser on LGBTQ2 issues.

The openly gay MP for Edmonton Centre will spearhead consultations with LGBTQ2 Canadians -- an acronym referring to lesbians, gays, bisexual, transgender, queer, questioning and two-spirited people, a term used broadly to describe indigenous people who identify as part of the community -- on how the Liberal government will respond to many of the issues raised in the Egale report.

That includes exploring an apology to LGBTQ2 people whose lives and careers were disrupted by government policies over the decades as well as formal pardons or outright erasure of criminal records for those convicted under laws now considered discriminatory.

No specific timeline was given, although a senior government source said an apology is likely to be the first priority.

It remains to be seen whether that apology would come with compensation, but Boissonnault left the door open.

"We will take the time to make sure that we get this right," he said.

Helen Kennedy, the executive director of Egale, attended the news conference Tuesday and welcomed Bill C-32 as an important step, saying the LGBTQ2 community will use it "as a springboard" to get more of the changes called for in the report.

"I would rather be standing here today than fighting this government down the block in the Supreme Court."