The State Department has urged US citizens to "exercise increased caution" whilst in Tanzania due to concerns over crime, terrorism and official actions targeting people on the basis of their gender or sexual identity.
Violent crime is "common" in Tanzania, the State Department said on Wednesday, citing risks of assault, kidnapping, sexual assault and carjacking.
"Terrorist groups continue plotting possible attacks in Tanzania," the advisory also stated.
It added that lesbian, gay, bisexual, transgender and intersex (LGBTI) persons have been "arrested, targeted, harassed and/or charged with unrelated offences."
"Individuals detained under suspicion of same-sex sexual conduct could be subject to forced anal examinations," the State Department noted.
Wednesday's advisory does not cite specific incidents of crime, terrorism or abuse of LGBTI persons.
In the case of violent crime, the State Department did say that "local police may lack the resources to respond effectively."
Regarding the threat of terrorism, the advisory warned that attacks may target "embassies, police stations, mosques and other places frequented by Westerners."
In the Tanzania section of its 2017 global survey of terrorism, the State Department pointed to a series of small-scale attacks in which "masked gunmen killed more than 30 police and local political officials in the Pwani region."
The perpetrators did not claim allegiance to a terrorist group, last year's terrorism report on Tanzania added.
The December 26 travel advisory concerning LGBTI persons may have come partly in response to comments in October by Dar es Salaam Governor Paul Makonda.
"I have received reports that there are so many homosexuals in our city, and these homosexuals are advertising and selling their services on the internet," Mr Makonda said in a video posted to YouTube.
"Therefore, I am announcing this to every citizen of Dar es Salaam: If you know any gays ... report them to me.”
Tanzania is designated a "Level 2" travel destination on a 4-level scale established by the Trump administration last year.
Kenya and Uganda are also listed as Level 2 countries where the US advises more than normal precautions.
Somalia and South Sudan are both given Level 4 designations, which carry a "Do Not Travel" warning.
Sudan receives a Level 3 classification, whereby US citizens are urged to "Reconsider Travel."
Rwanda is among the countries said to require no special precautions on the part of travelers.