A Tuesday morning massacre carried out by the Islamist extremist group al-Shabaab left 36 people dead, their bodies lined up on the ground in a quarry in northeast Kenya.

The assailants launched the attack as the victims slept in their tents at the quarry in the village of Kormey, located near the border with Somalia, a resident told Reuters.

"The militia separated the Muslims, then ordered the non-Muslims to lie down where they shot them in the head at close range," Hassan Duba, an elder from a nearby village, told the news agency.

Tuesday's massacre marks the latest in a string of attacks carried out by al-Shabaab, based in Somalia, in retaliation for Kenyan forces joining the effort to defeat the militants in other Kenyan cities and Somalia.

"We are uncompromising in our beliefs, relentless in our pursuit, ruthless against the disbelievers and we will do whatever necessary to defend our Muslim brethren suffering from Kenya's aggression," said Ali Mohamud Rage, a spokesman for the group, according to Reuters.

Kenyan Police Chief David Kimaiyo announced his resignation following Tuesday's attack. Kenyan President Uhuru Kenyatta accepted his resignation and also fired Interior Minister Joseph Ole Lenku, the BBC reported.

Kenyatta announced former army general Joseph Nkaissery as his nomination for the new interior minister. It is not clear who will be the new police chief. 

The replacement signifies Kenyatta's intent to declare war against the Islamist militants who, less than two weeks ago, killed 28 people in an attack on a bus traveling in the same area near the border.

"This is a war against Kenya and Kenyans," the president said in a televised speech, according to the BBC. "It is a war that every one of us must fight."