Kenya's president has replaced his interior minister and the chief of police in the wake of fresh terrorist attacks in the country's north-east.

At least 36 labourers died when gunmen crept up on the workers' tents while they slept at a quarry near the town of Mandera and executed them, beheading at least two.

In the wake of heavy criticism about an insipid government response to the insecurity, Kenyan president Uhuru Kenyatta sacked much-maligned interior minister Joseph Ole Lenku and the chief of police.

"We will not flinch or relent in the war against terrorism in our country and our region," Mr Kenyatta said.

Hassan Duba, a village elder at Korome near the site of the attack, said the attackers separated non-Muslims from Muslims before killing them.

"The militia separated the Muslims, then ordered the non-Muslims to lie down where they shot them in the head at close range," Mr Duba said.

Kenya's government confirmed 36 people were killed and cited survivors saying about 20 attackers were involved.

A senior police official said there were fears others may have been abducted.

"We have lost 36 people, but there are others missing," said the police official, who asked not to be named.

"We don't know whether they were taken by the attackers."

Islamic militant group Al Shabaab claimed responsibility for the attacks, and vowed to be "uncompromising, relentless and ruthless" in fighting Kenya.

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.

Al Shebaab spokesman Sheikh Ali Mohamud Rage

"This latest attack was part of a series of attacks planned and executed by the Mujahideen as a response to Kenya's occupation of Muslim lands and their ongoing atrocities, such as the recent airstrikes on Muslims in Somalia which caused the death of innocent Muslims and the destruction of their properties and livestock, as well as the continued suffering of Muslims in Mombasa," Shebaab spokesman Sheikh Ali Mohamud Rage said in a statement.

"As Kenya persists in its occupation of Muslim lands, kills innocent Muslims, transgresses upon their sanctities and throws them into prisons, we will persist to defend our land and our people from their aggression.

"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."

Quarry assault latest in string of Al Shabaab attacks

The quarry killings follow a separate attack on Monday night in the town of Wajir - which like Mandera is close to the dangerous border with war-torn Somalia - which left one person dead and 12 wounded when gunmen hurled grenades and fired into a bar.

The attack is also close to where the militants last month executed 28 non-Muslims who were grabbed from a bus.

Kenya has suffered a series of attacks since invading Somalia in 2011 to attack the militant group.

Al Shabaab have in past attacks said they were punishing Kenya for sending troops to join African peacekeepers battling the Islamists in Somalia.

Opponents say the presence of Kenyan troops has not protected Kenya and should be withdrawn.

"They were supposed to create a buffer between our countries and the chaos on the other side. But it has not done that. So we are saying leave," Dennis Onyango, a spokesman for opposition politician and former prime minister Raila Odinga, said.

The government typically blames Al Shabaab and has promised to step up security, but the public has grown increasingly frustrated and, after the Mandera bus attack, small protests have been staged demanding action.

"It is sad that we have another 36 people who were attacked and killed late last night in the same manner it happened on a bus recently," Mandera county governor Ali Roba said.

Several key unions have warned members to leave the restive north-east until the government can ensure their safety.

Professionals working in the largely Muslim and ethnic Somali north-eastern regions often come from further south in Kenya, where Christians make up about 80 per cent of the population.

Those working in the quarry attacked on Tuesday were also reported to have been from outside the region.

Worries over internal security mounted when Shebaab rebels massacred 100 people in a string of raids against villages in the Lamu region on the Kenyan coast in June and July.