Joan Kagezi, the top Ugandan state prosecutor in the trial of 13 men accused of a deadly al-Shabab bomb attack, has been shot dead in Kampala.
Ms Kagezi was targeted by gunmen on a motorcycle as she was on her way home.
The suicide bombing in Kampala in 2010 killed 76 people as they watched the football World Cup final.
Last week, the US embassy in Uganda warned that Westerners – including Americans – may be targeted for “terrorist” attacks in Kampala.
Ms Kagezi, the senior principal state attorney, headed the directorate of public prosecution’s anti-terrorism and war crimes division.
Kampala police spokesman Patrick Onyango said: “They were trailing her on a motorcycle… They shot her dead.”
Ms Kagezi was taken to the main hospital in the capital but died on the way.
The BBC’s Catherine Byaruhanga in Kampala says some Ugandans are now wondering whether she was given enough protection.
Last week the US said it had “received information of possible threats” at city locations where Western nationals gather.
Uganda’s government said the US had warned of a possible suicide bomber trying to enter the country.
Uganda was under threat because it is a key contributor to the African Union mission fighting al-Shabab inside Somalia, a spokesman said.