Updated

Uganda is looking to outlaw homosexual activity across the country as lawmakers passed a bill prescribing jail terms of up to 10 years for those who have same-sex relations.

A roll call was ordered by the House speaker before the packed parliamentary chamber in the capital, Kampala, easily passed the bill late Tuesday after. Nearly all of the 389 legislators present supported the bill.

"Congratulations," said Speaker Anita Among. "Whatever we are doing, we are doing it for the people of Uganda."

The bill now heads to the desk of President Yoweri Museveni, who has also expressed support for it. In a recent speech, Museveni accused Western countries of "trying to impose their practices on other people."

UGANDA PRESIDENT’S CONTROVERSIAL SON UNNERVES COUNTRY WITH TWEETS ABOUT SUCCEEDING HIS FATHER

Two people holding hands

Gay Ugandan refugees who fled from their country to neighboring Kenya, return after shopping for food in Nairobi, Kenya on June 11, 2020.  (AP Photo/Brian Inganga)

The legislation was first introduced last month by its sponsor, who said his goal was to punish "promotion, recruitment, and funding" related to LGBTQ activities.

The bill creates an offense of "attempted homosexuality," punishable by up to 10 years jail time.

It also creates an offense called "aggravated homosexuality," which applies to sexual relations among those infected with HIV, minors and other categories. Its punishment is not immediately clear.

Same-sex activity is already punishable with life imprisonment under a law targeting "carnal knowledge against the order of nature."

And homosexuality is illegal in more than 30 of Africa’s 54 countries.

People wearing masks

Kenyan gays and lesbians and others supporting their cause wear masks to preserve their anonymity in Nairobi, Kenya on Feb. 10, 2014.  (AP Photo/Ben Curtis)

The bill had its opposition.

Fox Odoi, a lawmaker who representing the dissenters, called it "ill-conceived" and said it was unconstitutional because it "criminalizes individuals instead of conduct."

Human Rights Watch described the legislation as "a more egregious version" of a similar law that passed in 2014, which a court later nullified on procedural grounds.

If signed into law, "would violate multiple fundamental rights, including rights to freedom of expression and association, privacy, equality, and non-discrimination," according to Human Rights Watch.

AT LEAST 36 PEOPLE KILLED BY EXTREMISTS LINKED TO IS GROUP IN EASTERN CONGO

Oryem Nyeko, a Human Rights Watch researcher in Uganda and Tanzania, also condemned the bill and urged the legislature to stop targeting the LGBT community.

"One of the most extreme features of this new bill is that it criminalizes people simply for being who they are as well as further infringing on the rights to privacy, and freedoms of expression and association that are already compromised in Uganda," the researcher said earlier this month. "Ugandan politicians should focus on passing laws that protect vulnerable minorities and affirm fundamental rights and stop targeting LGBT people for political capital."

3 KENYAN LEGISLATORS, SEVERAL DEMONSTRATORS ARRESTED AS ANTI-GOVERNMENT PROTESTS CONTINUE

A man's face

A Ugandan man is seen during the third Annual Lesbian, Gay, Bisexual and Transgender (LGBT) Pride celebrations in Entebbe, Uganda on Aug. 9, 2014. (AP Photo/Rebecca Vassie)

A recent decision of the Church of England to recognize and honor civil marriages of same-sex couples also has inflamed many people in the country.

CLICK HERE FOR THE FOX NEWS APP

"The Church of England has departed from the Anglican faith and are now false teachers," Ugandan Archbishop Stephen Kaziimba said last month, describing a rise in same-sex relations as "a crisis at hand."

Many in Uganda, like the president, see homosexuality as imported from the West.

The Associated Press contributed to this report.