It was the latest in a spate of deadly attacks targeting Christians in the mainly Muslim region.
In December 2014, al-Shabab killed 38 non-Muslims at a quarry after separating them from Muslim workers.
A few months earlier, 28 people were killed after Muslim passengers were split up from the other passengers.
The attack happened as "planned" and was aimed at Christians in Mandera town, a radio station run by al-Shabab has reported.
The group wanted non-Muslims to leave what it regarded as Muslim areas, a spokesman told the BBC.
Mandera County commissioner Fredrick Shiswa said the militants had also targeted a telecommunication site, but this was done to divert the attention of the security forces from the "actual attack".
"This must have been planned over a long period... It was executed with a lot efficiency," Mr Shiswa said in a BBC interview.
Sadiq Sharif, who was among 27 survivors, said al-Shabab raided the compound despite the fact that it was close to a police station in the middle of the town.
"However, I would like to thank the four local police reservists who rescued us. If it were not for them, no-one would have survived," he told the BBC.
More about:






