OTTAWA -- Following is the text of Prime Minister Justin Trudeau's apology in the House of Commons for the federal government's past treatment of members of the LGBTQ community.

---

One of the greatest choices a person can make in their life is the choice to serve their fellow citizens. Maybe it's in government, in the military, or in a police force. In whatever capacity one serves, dedicating your life to making Canada -- and indeed, the world -- a better place is a calling of the highest order.

Now imagine, if you will, being told that the very country you would willingly lay down your life to defend doesn't want you. Doesn't accept you. Sees you as defective. Sees you as a threat to our national security.

Not because you can't do the job, or because you lack patriotism or courage -- no, because of who you are as a person, and because of who your sexual partners are.

Now imagine, Mr. Speaker, being subjected to laws, policies, and hiring practices that label you as different -- as "less than."

Imagine having to fight for the basic rights that your peers enjoy, over and over again.

And imagine being criminalized for being who you are.

This is the truth for many of the Canadians present in the gallery today, and those listening across the country.

This is the devastating story of people who were branded criminals by the government. People who lost their livelihoods, and in some cases, their lives.

These aren't distant practices of governments long forgotten. This happened systematically, in Canada, with a timeline more recent than any of us would like to admit.

Mr. Speaker, today we acknowledge an often-overlooked part of Canada's history. Today, we finally talk about Canada's role in the systemic oppression, criminalization, and violence against the lesbian, gay, bisexual, transgender, queer, and two-spirit communities.

And it is my hope that in talking about these injustices, vowing to never repeat them, and acting to right these wrongs, we can begin to heal. ...

Discrimination against LGBTQ2 communities was quickly codified in criminal offences like "buggery," "gross indecency" and bawdy house provisions.

Bathhouses were raided, people were entrapped by police.

Our laws bolstered and emboldened those who wanted to attack non-conforming sexual desire.

Our laws made private and consensual sex between same-sex partners a criminal offence, leading to the unjust arrest, conviction, and imprisonment of Canadians. This criminalization would have lasting impacts for things like employment, volunteering, and travel.

Those arrested and charged were purposefully and vindictively shamed. Their names appeared in newspapers in order to humiliate them, and their families.

Lives were destroyed. And tragically, lives were lost. ...

Over our history, laws and policies enacted by the government led to the legitimization of much more than inequality -- they legitimized hatred and violence, and brought shame to those targeted.

While we may view modern Canada as a forward-thinking, progressive nation, we can't forget our past: The state orchestrated a culture of stigma and fear around LGBTQ2 communities. And in doing so, destroyed people's lives.

Mr. Speaker, a purge that lasted decades will forever remain a tragic act of discrimination suffered by Canadian citizens at the hands of their own government.

From the 1950s to the early 1990s, the government of Canada exercised its authority in a cruel and unjust manner, undertaking a campaign of oppression against members, and suspected members, of the LGBTQ2 communities.

The goal was to identify these workers throughout the public service, including the foreign service, the military, and the RCMP, and persecute them.

You see, the thinking of the day was that all non-heterosexual Canadians would automatically be at an increased risk of blackmail by our adversaries due to what was called "character weakness."

This thinking was prejudiced and flawed. And sadly, what resulted was nothing short of a witch-hunt.

The public service, the military, and the RCMP spied on their own people, inside and outside of the workplaces. Canadians were monitored for anything that could be construed as homosexual behaviour, with community groups, bars, parks, and even people's homes constantly under watch.

During this time, the federal government even dedicated funding to an absurd device known as the Fruit Machine -- a failed technology that was supposed to measure homosexual attraction.

When the government felt that enough evidence had accumulated, some suspects were taken to secret locations in the dark of night to be interrogated.

They were asked invasive questions about their relationships and sexual preferences. Hooked up to polygraph machines, these law-abiding public servants had the most intimate details of their lives cut open.

Women and men were abused by their superiors, and asked demeaning, probing questions about their sex lives. Some were sexually assaulted.

Those who admitted they were gay were fired, discharged, or intimidated into resignation. They lost dignity, lost careers, and had their dreams -- and indeed, their lives -- shattered. ...

Under the harsh glare of the spotlight, people were forced to make an impossible choice between career and identity.

The very thing Canadian officials feared -- blackmail of LGBTQ2 employees -- was happening. But it wasn't at the hands of our adversaries; it was at the hands of our own government.

Mr. Speaker, the number one job of any government is to keep its citizens safe. And on this, we have failed LGBTQ2 people, time and time again.

It is with shame and sorrow and deep regret for the things we have done that I stand here today and say: We were wrong. We apologize. I am sorry. We are sorry.

For state-sponsored, systemic oppression and rejection, we are sorry.

For suppressing two-spirit Indigenous values and beliefs, we are sorry.

For abusing the power of the law, and making criminals of citizens, we are sorry. ...

To all the LGBTQ2 people across this country who we have harmed in countless ways, we are sorry.

To those who were left broken by a prejudiced system;

And to those who took their own lives -- we failed you.

For stripping you of your dignity;

For robbing you of your potential;

For treating you like you were dangerous, indecent, and flawed;

We are sorry.

To the victims of the purge, who were surveilled, interrogated, and abused;

Who were forced to turn on their friends and colleagues;

Who lost wages, lost health, and lost loved ones;

We betrayed you. And we are so sorry.

To those who were fired, to those who resigned, and to those who stayed at a great personal and professional cost;

To those who wanted to serve, but never got the chance to because of who you are -- you should have been permitted to serve your country, and you were stripped of that option.

We are sorry. We were wrong.

Indeed, all Canadians missed out on the important contributions you could have made to our society.

You were not bad soldiers, sailors, airmen and women. You were not predators. And you were not criminals.

You served your country with integrity, and veterans you are.

You are professionals. You are patriots. And above all, you are innocent. And for all your suffering, you deserve justice, and you deserve peace.

It is our collective shame that you were so mistreated. And it is our collective shame that this apology took so long -- many who suffered are no longer alive to hear these words. And for that, we are truly sorry.

To the loved ones of those who suffered;

To the partners, families, and friends of the people we harmed;

For upending your lives, and for causing you such irreparable pain and grief -- we are sorry. ...

We also thank members of the We Demand an Apology Network, our LGBTQ2 Apology Advisory Council, and the Just Society Committee for Egale, as well as the individuals who have long advocated for this overdue apology. ...

We must remember, and we will remember. We will honour and memorialize the legacy of those who fought before us in the face of unbearable hatred and danger.

Mr. Speaker, it is my hope that we will look back on today as a turning point. But there is still much work to do.

Discrimination against LGBTQ2 communities is not a moment in time, but an ongoing, centuries-old campaign.

We want to be a partner and ally to LGBTQ2 Canadians in the years going forward. There are still real struggles facing these communities, including for those who are intersex, queer people of colour, and others who suffer from intersectional discrimination.

Transgender Canadians are subjected to discrimination, violence, and aggression at alarming rates. In fact, trans people didn't even have explicit protection under federal human rights legislation until this year. ...

And, Mr. Speaker, I am proud to say that earlier today in this House we tabled the Expungement of Historically Unjust Convictions Act. This will mean that Canadians previously convicted of consensual sexual activity with same-sex partners will have their criminal records permanently destroyed.

Further, I am pleased to announce that over the course of the weekend, we reached an agreement in principle with those involved in the class action lawsuit for actions related to "the purge."

Never again will our government be the source of so much pain for members of the LGBTQ2 communities.

We promise to consult and work with individuals and communities to right these wrongs and begin to rebuild trust. We will ensure that there are systems in place so that these kinds of hateful practices are a thing of the past. Discrimination and oppression of LGBTQ2 Canadians will not be tolerated anymore. ...

Mr. Speaker, Canada's history is far from perfect.

But we believe in acknowledging and righting past wrongs so that we can learn from them.

For all our differences, for all our diversity, we can find love and support in our common humanity.

We're Canadians, and we want the very best for each other, regardless of our sexual orientation, or our gender identity and expression. We will support one another in our fight for equality.

And Canada will stand tall on the international stage as we proudly advocate for equal rights for LGBTQ2 communities around the world.

To the kids who are listening at home and who fear rejection because of their sexual orientation or their gender identity and expression;

And to those who are nervous and scared, but also excited at what their future might hold;

We are all worthy of love, and deserving of respect.

And whether you discover your truth at six or 16 or 60, who you are is valid.

To members of the LGBTQ2 communities, young and old, here in Canada and around the world:

You are loved. And we support you. ...

To the trailblazers who have lived and struggled, and to those who have fought so hard to get us to this place: thank you for your courage, and thank you for lending your voices. I hope you look back on all you have done with pride.

It is because of your courage that we're here today, together, and reminding ourselves that we can, and must, do better.

For the oppression of the lesbian, gay, bisexual, transgender, queer, and two-spirit communities, we apologize. On behalf of the government, Parliament, and the people of Canada: We were wrong. We are sorry. And we will never let this happen again.