The U.S. Embassy in Uganda told its citizens to seek safety on Saturday, warning that local authorities had uncovered a "terrorist cell" run by Somali militant group al Shabaab, which they believed was planning an imminent attack.
Ugandan police later said it had foiled an attack in central Kampala and was increasing security at hotels and other public places, but declined to say who was behind the attack.
The Embassy, in a statement published on its website, said it was not aware of specific targets but said the authorities had increased security at key sites including Entebbe International Airport.
"Today Ugandan authorities reported the discovery of an al-Shabaab terrorist cell in Kampala, Uganda," the Embassy said. "We remain in close contact with our Ugandan counterparts as investigations continue into what appears to have been planning for an imminent attack."
At a news conference later, Ugandan police said they had seized explosives and arrested an unspecified number of foreigners after foiling an attack.
But Fred Enanga, a spokesman for Uganda Police, declined to say if he believed the cell was connected to Islamist militants al Shabaab or to name the nationalities of those detained.
Uganda, as one of the countries that contribute forces to an African Union peacekeeping mission battling al Shabaab in Somalia, has suffered militant attacks in recent years, and al Shabaab has threatened more.
The U.S. Embassy, shortly before issuing its announcement, told its citizens, in a message posted on Twitter, to stay at home or proceed to a safe location while Ugandan authorities completed operations against a suspected cell in Kampala.
The Embassy has said Uganda faces a "continued threat" and has issued other alerts during the year about possible attacks.
Al Shabaab, which is aligned with al Qaeda, claimed responsibility for the attack on the Westgate shopping mall in Nairobi in neighboring Kenya a year ago, in which 67 people died.
This month the group warned of revenge against its enemies after it said its leader Ahmed Godane had been killed in a U.S. air strike on his encampment in Somalia.
In 2010, Al Shabaab bombed sports bars in Uganda where people were watching the soccer World Cup on television.