At least three Somali soldiers were killed in a suicide bomb attack in Afgoye district, a town 30 km to the north west of the capital Mogadishu, police and militants said.