Canadians convicted of crimes due to their sexuality will be able to get their records expunged under new legislation announced by the Liberal government on Wednesday.

At a Parliament Hill event, Prime Minister Justin Trudeau said that the legislation would come later this year. For the second year in a row, Trudeau raised the Pride Flag on Parliament Hill, along with the Trans Rights Flag and a special Canada 150 Pride Flag.

Trudeau has said before the government was looking at the issue, but Wednesday made it clear there will be a process for getting these crimes removed from a criminal record.

“Our government will be moving forward with a process for the expungement of criminal convictions for Canadians who were unjustly convicted of a crime simply for who they were and who they love.”

LGBTQ people were often convicted of “buggery” or “gross indecency” in the 1960s, 70s and even 80s simply for being gay. The criminal records for many people have remained in place, limiting their employment and travel options.

Most of the laws have since been pulled from the books, but the convictions remain.

“We will passionately defend the rights of all of our citizens,” Trudeau said. “We are proud to take concrete action to make that a reality.”

The government has also recommitted to offering a formal apology this year to public servants and members of the military who were forced from their jobs because of their sexual orientation.

“I believe it’s essential to make amends for past wrongs, not to simply gloss over them,” Trudeau told a crowd of about 100 people assembled for the event.

THE CANADIAN PRESS/Adrian Wyld

Canadian Prime Minister Justin Trudeau jokes around with Liberal MP Randy Boissonnault as they compare socks during a ceremony to raise the pride and transgender flags on Parliament Hill in Ottawa, Wednesday June 14, 2017.

The government has completed many of the commitments it made on LGBTQ issues during the campaign, but a promise to end the ban on men who have sex with men giving blood was only tweaked, not eliminated.

MP Randy Boissonnault, the prime minister’s special advisor on LGBTQ issues, acknowledge there is more work to be done.

“We should recognize that there are still challenges to overcome,” he said.

He said the Pride flags flying over the Hill are acknowledgements of the work that had been done.

“They represent the collective efforts of countless LGBTQ advocates and allies who have fought for equality in Canada and around the world,” he said.