Al-Shabab also posted a statement on social media saying the raiding party killed eight people and took two prisoners back over the border.

Albert Kimathi, district commissioner for Dadab, an area near the Somali border, said the rebels made two simultaneous attacks on police posts. Four people, two of them policemen, were killed and two wounded, he said.

"We are also missing two officers who may have ran away," Kimathi said.

Kenyan troops are part of the African Union peacekeeping force battling al-Shabab rebels, who are linked to al-Qaida.

Shabaab has been substantially weakened in the last two years, losing Mogadishu and swathes of central and southern Somalia to the African force, but the rebels have managed to mount raids across the border with Kenya.