MOGADISHU, Somalia (CNN) -- A senior U.N. official in Somalia was gunned down Sunday night as he exited a mosque after evening prayers, according to a journalist on the scene.
Osman Ali Ahmed, head of the U.N. development program in the war-torn capital of Mogadishu, was shot at about 7:50 p.m. and died from his wounds at an African Union-run hospital near Mogadishu airport, said the Shabelle Media Network journalist, whose name was withheld for security reasons.
Ahmed apparently was the target of the attack, an official with the U.N. program said, speaking on condition of anonymity because he was not authorized to discuss the situation.
The journalist said he spoke with Ahmed's mother-in-law, who lived with him in a house five blocks from the mosque. She confirmed that Ahmed had been ambushed by gunmen outside the mosque and shot twice in the head.
Ahmed's cousin was also wounded in the attack, the woman said. He was being treated for a gunshot wound in his leg at the same hospital.
Ahmed's killing follows the June 21 kidnapping of Hassan Mohamed Ali, head of the U.N. High Commissioner for Refugees' office in Mogadishu. He was abducted from his home on the outskirts of the city.
A week later, two Western aid workers were taken hostage by Islamist militants in Hodur, a Somali town near the Ethiopian border, but were released within hours.
Since December 2006, when Ethiopia's military invaded its neighbor to oust Islamists and install a U.N.-backed transitional government, insurgents have consistently battled the government and aid groups in Somalia.
The conflict has displaced hundreds of thousands of Somalis, further worsening a humanitarian crisis that dates back to the collapse of the country's last government in 1991.
Journalist Mohammed Amiin in Sweden contributed to this report