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 on her way home by motorbike gunmen, officials say.
The trial of the men, accused of links to the 2010 Kampala suicide bombing which killed 76 people, has been suspended.
Last week, the US embassy in Uganda warned of a possible "terrorist" attack.
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.
Her children were with her in the car but weren't harmed in the shooting, according to a statement by the Ugandan Information Minister Jim Muhwezi in the Daily Monitor.
The BBC's Catherine Byaruhanga in Kampala says some Ugandans are now wondering whether Ms Kagezi was given enough protection.
Our correspondent says there is now an increased presence of policemen and soldiers on the streets of the Ugandan capital.
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.