(CNN) -- A man who was fired by an international aid group in Somalia this week returned to the office and shot dead two aid workers, a government official and the aid agency said Friday.
Thursday's shooting occurred in the capital of Mogadishu at the compound of Medecins Sans Frontieres, also known as Doctors Without Borders. The slain workers provided emergency medical relief in the embattled city.
Somali Interior Minister Abdisamad Moalin Mohamud said the alleged shooter, who lost his job Wednesday, was in custody.
"He was not a simple gunman he was an employee with a high local position with the agency and he has a long history of working in the relief field " said Mohamud, who condemned the "ugly" incident.
He stressed that insurgents did not carry out the attack. Somalia has been mired in famine and violence, spurred by the efforts of Al-Shabaab, an al Qaeda-linked militant group that has waged war against the country's weak transitional government.
The shooting remains under investigation.
MSF identified the victims as 53-year-old Philipe Havet of Belgium, who was described as an experienced emergency coordinator who had worked with the agency since 2000 in Angola, the Democratic Republic of Congo, Indonesia, Lebanon, Sierra Leone and South Africa.
Also killed was Andrias Karel Keiluhu, known as "Kace", a 44-year-old doctor, who had worked with MSF since 1998 in his native Indonesia, as well as Ethiopia, Thailand and Somalia, the aid agency said.
MSF said the "exact circumstances of the shooting" are unclear.
"MSF's immediate priority is to take care of those most affected by this tragedy, in particular the families and colleagues of the victims," the group said in a statement.
"We are deeply shocked by this tragic event and we will greatly miss Philippe and Kace."
The shooting follows the killing of three U.N. World Food Programme workers last week in the central Somali town of Mataban. They were part of a mission to monitor food distribution at camps.
MSF plans to relocate some of its staff from Somalia, citing security concerns, according to its statement.
Still, an African Union commander told CNN Thursday that its forces in Somalia have successfully pushed Al-Shabaab out of Mogadishu.
Journalist Mohamed Amiin Adow contributed to this report