DAR ES SALAAM — The European Union has recalled its envoy in Tanzania and will review its relations with the country in response to a planned crackdown homosexuals.

Brussels also criticized what it saw as growing human rights violations in Tanzania.

“The E.U. regrets the deterioration of the human rights and rule of law situation in Tanzania and will be conducting a broad review of its relations with Tanzania,” spokeswoman Susanne Mbise said in a statement.

Paul Makonda, administrative chief of the capital Dar es Salaam, said last Wednesday that a special committee would seek to identify and punish homosexuals, prostitutes and online fraudsters in the city from this week.

The foreign ministry has said Makonda’s anti-gay campaign represented his own views and not the official government position.

Homosexuality remains taboo across much of Africa and gay people face discrimination or persecution, with rights groups often reluctant to speak publicly in defense of gay rights.

President John Magufuli has cracked down on homosexuality since winning power in 2015, and a conviction for having “carnal knowledge of any person against the order of nature” can lead to a sentence of up to 30 years in jail.

Last October, at least 12 men were arrested at a Dar es Salaam hotel in a raid on a gathering which authorities said was to promote same-sex relationships.

The United States on Saturday advised its citizens in Tanzania to review their social media and internet activity and remove any material that may violate Tanzania’s laws on homosexual practices.

FOLLOW NBC OUT ON TWITTER, FACEBOOK AND INSTAGRAM