Canadian political leaders and parliamentarians are denouncing a new law passed in Uganda that imposes harsh penalties, including the death penalty, for certain cases involving homosexuality.

Prime Minister Justin Trudeau, who previously called the legislation "appalling and abhorrent," said Canada strongly condemns the law.

"We'll continue to stand with 2SLGBTQI+ people — and stand up for 2SLGBTQI+ rights — at home and abroad," he said in a statement Monday on Twitter.

Foreign Affairs Minister Melanie Joly called the legislation a "blatant violation of the human rights and fundamental freedoms of LGBTQ+ Ugandans," adding that Canada "firmly condemns" the law.

In a statement provided by Global Affairs Canada, she said Canada calls on the government of Uganda to revoke the legislation.

"The reversal of human rights that this law represents is deeply concerning and we are disturbed by the heinous forms of violence it legalizes against a segment of Uganda's population, only because of who they are and who they love," Joly said.

"Canada unequivocally opposes the use of the death penalty in all cases, everywhere. This form of punishment is incompatible with international human rights laws and human dignity."

The Canadian Pride Caucus, which includes members of the House of Commons and Senate, also condemned the Ugandan legislation.

"The rise of repression against 2SLGBTQI+ communities in many countries and in our Canadian society is extremely worrying," Independent Senator Rene Cormier and caucus co-chair said.

"Canada's progress on many fronts can have positive repercussions outside of our country and it is imperative that we work towards taking more leadership in this regard."

NDP MP Blake Desjarlais, who also serves as caucus co-chair, added "progress is hard won and easily lost."

"Canada must be brave and ensure we take a firm stand against hate and bigotry at home and around the world," Desjarlais said.

WHAT IS IN THE LAW?

Ugandan President Yoweri Museveni signed the Anti-Homosexuality Act into law on Monday.

Homosexuality is already illegal in Uganda under a colonial-era law that criminalizes sexual activity "against the order of nature," the punishment of which is life imprisonment. More than 30 of Africa's 54 countries criminalize homosexuality.

Museveni returned the bill to the country's national assembly in April, asking to differentiate between those who identify as LGBTQ and those who engage in homosexual acts.

While proponents of the law argue that it does not criminalize those who identify as LGBTQ, it does prescribe the death penalty for "aggravated homosexuality," which is defined as sexual relations involving minors and people with HIV among other groups.

Anyone convicted of what the bill considers "attempted aggravated homosexuality" can face up to 14 years in prison, while "promoting" homosexuality can result in a 20-year sentence.

A panel of judges previously struck down an anti-gay bill put in place in 2014 over a lack of quorum in the plenary session that passed the legislation.

A previous bill in 2009, dubbed "kill the gays" for initially proposing the death penalty for certain homosexual acts, was later changed to replace the death penalty with a maximum sentence of life imprisonment.

WHAT HAS BEEN THE REACTION?

Amnesty International has called the law "a grave assault on human rights."

U.S. President Joe Biden described it as "a tragic violation of universal human rights," while U.K. Minister of State (Development and Africa) Andrew Mitchell said the legislation "undermines the protections and freedoms of all Ugandans enshrined in the Ugandan Constitution."

A joint statement from the U.S. HIV/AIDS program PEPFAR, the Global Fund to Fight AIDS, Tuberculosis and Malaria, and the Joint United Nations Programme on HIV/AIDS said the law puts Uganda's anti-HIV fight "in grave jeopardy."

With files from The Associated Press and Reuters