Dr Christophe Fournier, the international council president of MSF, said: "We find this attack against one of our teams absolutely intolerable, and a serious violation of the humanitarian action to which our late colleagues were so committed."
A Kenyan doctor, a French logistics expert, a Somali driver with the aid group and a local journalist were said to have been among those killed.
Fighting has been raging in Somalia since the Islamic Courts movement was ousted from government by Ethiopia-backed forces at the beginning of 2006.
Anti-government forces have been continually attacking state officials and installations. African Union peacekeepers have been installed in the country but have not stemmed attacks.
Native staff to stay on
At least 87 employees from 14 projects have been taken out of the country. Native staff will continue working.
"This attack has a direct impact on the level of assistance to the Somali population," Dr Fournier said.
"Although life-saving medical activities continue under the supervision of our dedicated Somali colleagues, the suspension will clearly hamper the essential medical work of MSF in Somalia."
MSF has been working in Somalia for more than 16 years and was providing medical care in 11 of the country's 18 regions.