A Somali staff member of Medecins Sans Frontieres shot dead two of the aid agency's foreign workers in Somalia's capital Mogadishu on Thursday, police said.

Police spokesman Abdullahi Barise said the gunman had been taken into custody. A Reuters witness said the man was dragged from the building, still holding a pistol.

The man was armed with a pistol and we understand he had a quarrel with the coordinator. It is very shocking, Barise said. He said the gunman had worked as a logistics officer for the agency.

The MSF official, who declined to be identified, also said the Somali gunman had worked for the aid agency.

One of the aid workers was shot dead at the scene, and the other was wounded and taken to hospital, where he died of his wounds, according to police and medical staff at the hospital.

MSF said in a statement: We confirm that a serious shooting incident has taken place in the MSF compound in Mogadishu. At this point we don't have more information about the scale and the extent of this incident. MSF is doing everything it can to ensure the security of its staff.

It would neither confirm nor deny the deaths.

MSF, or Doctors Without Borders, operates in a number of locations in Somalia, providing emergency aid to people suffering from famine and the violence that has plagued the country for decades.

The attack happened in a bustling part of the capital which is under the control of government and African Union troops.

In mid-October, gunmen kidnapped two Spanish aid workers for MSF in Kenya, near the Somali border.

Somalia descended into chaos in 1991 after dictator Mohamed Siad Barre was ousted, and has not had a functional central government since.

Last week, a gunman killed three Somali aid workers, including two with the U.N. World Food Programme (WFP), in the central Somali town of Matabaan, in a region under the control of the Ahlu Sunna militia group, which supports the Somali government.

Kenyan troops crossed into Somalia in October after a wave of kidnappings and cross-border raids it blamed on al Shabaab Islamist rebels, including the kidnap of the MSF Spaniards.

MORE ATTACKS IN KENYA, SOUTHERN SOMALIA

Kenyan police said suspected al Shabaab militia members shot a member of a local security committee at the Daadab refugee camp in Kenya near the border on Thursday night.

A man, a member of a community security group who works with us has been attacked. He was shot by people we believe are al Shabaab militants. Fortunately he is alive. Our vehicle is on the way to Garissa General Hospital, North Eastern police commander Leo Nyongesa told Reuters.

A Transitional Federal Government soldier and an al Shabaab spokesman said the insurgents attacked a convoy of Kenyan troops inside Somalia in the southern town of Qoqani.

First, al Shabaab attacked Qoqani airstrip in the morning and then ambushed the Kenyan convoy, but I have no details about casualties, Mohamed Mural, a Somali government soldier told Reuters by phone from Qoqani on Thursday.

Kenya's military spokesman was not immediately available for comment.

Sheikh Abdiasis Abu Musab, a spokesman for al Shabaab told Reuters the fighters had ambushed Kenyan soldiers between Qoqani and Tabda on Thursday, burning three of their vehicles.

It was at 4.00 pm (1300 GMT) when we ambushed them. A land mine hit one vehicle and when the Kenyans stopped and got down from the vehicles, we opened fire on them. We burnt other the two using rocket-propelled grenades, he added.

(Additional reporting by Noor Ali in Isiolo and Feisal Omar in Mogadishu; Writing by George Obulutsa; Editing by Peter Graff)