A federal judge has approved a landmark deal to compensate members of the military and other agencies who were investigated and sometimes fired because of their sexual orientation.

Cheers of joy and celebratory hugs greeted the decision of Federal Court Justice Martine St-Louis after hours of testimony Monday from class action members.

"This is vindication after years of the persecution that I personally experienced as part of the military," said Lt-Col. Catherine Potts. "It's truly a human rights victory for all of us."

Gay military veterans told St-Louis they were interrogated, harassed and spied on because of their sexuality.

Sobbing could be heard from onlookers as a steady stream of men and women took turns at a microphone to lament how being gay or lesbian made them enemies of their own country.

The discriminatory policies that often ruined careers and lives had their roots in federal efforts that began as early as the 1940s to delve into the personal lives of people who were considered security risks.

Potts, a 37-year veteran who still serves with the air force, says she lived in the shadow of the anti-gay policy for years, watching how she spoke and dressed to avoid attracting attention.

"I lived with fear, I was consumed by it," she told the court. "When would the game be up and would I be found out?"

Potts was followed by military police and her phone was tapped.

"I was hunted and now, sadly, it haunts me. I want to be able to put all that behind me."

An agreement in principle in the court action was drafted last November, just days before the government delivered a sweeping apology for decades of discrimination against members of the LGBTQ community.

The final settlement includes at least $50 million and up to $110 million in total compensation, with eligible individuals each expected to receive between $5,000 and $175,000, depending on the gravity of their cases.

The vast majority of those who appeared in court Monday spoke in favour of the settlement.

"I'm absolutely ecstatic. It's a great day for justice in Canada," said lawyer Doug Elliott, who represented the members.

"I think Canadians can be proud that our country has not turned its back on these victims of a bad era in our history when people were treated like lesser human beings because they were gay."

If the next steps unfold as expected, people will start receiving cheques in the fall, Elliott said.

A total of about 1,000 people are expected to sign on to the class action, he said.

"It could go higher, but I don't think so. First, a lot of the gay men are dead, either from suicide or AIDS. And also there is a certain group within our class (for whom) the psychological barriers are so great, that they're just not going to come forward," Elliott said.

"And that's a shame because it shows that the purge is still having a negative effect on people in Canada in a way that's really sad."

The settlement entails several reconciliation and remembrance measures, including a national monument, a Canadian Museum for Human Rights exhibition, declassification of archival records and a citation akin to a medal for affected people.

The Liberal government has also introduced legislation that would allow people to apply to have their criminal convictions for consensual sexual activity between same-sex partners erased from the public record.

Keep reading