When President Uhuru Kenyatta blamed "local political networks" on Tuesday for extremist attacks on several coastal villages, Kenyans were left wondering whom to believe: their president or the Somali terrorist group that claimed responsibility.

The Shabab, an Al Qaeda affiliate, claimed that it carried out the attacks, which killed dozens of people Sunday and Monday in Mpeketoni town and several villages near the tourist resort of Lamu.

The attacks — and the political response to them — threatened to deepen ethnic tension in a country still recovering from ethnic violence that followed the 2007 disputed election.

Local media offered accounts of Islamist gunmen speaking Somali, and questioning people on their religion, before shooting Christian men.

Kenyatta said the two nights of deadly attacks were the work of local leaders seeking to divide the country, but did not name those he saw as responsible for what he called "well-planned, orchestrated and politically motivated violence."

"This was not an Al Shabab terrorist attack," Kenyatta said in a televised address after at least 60 people died in attacks by armed extremists in Mpeketoni on Sunday night and in nearby villages Monday.

There were unconfirmed reports Tuesday that women may have been kidnapped, with dozens reported missing by the Kenyan Red Cross. The abduction of women has been the trademark of another African militant group, Boko Haram, which is based in Nigeria.

According to analysts, the Shabab often claims responsibility for its attacks, sometimes taking days or weeks to do so, and merely "welcomes" attacks made by allied groups. A spokesman for the Shabab, speaking after Kenyatta's live televised address, insisted that the attacks were its work.

"It was our commandos who were taking care of things over the last two days in the Lamu area and they will continue to do so. We are fighting there because Kenyan troops are in our country and occupying parts of our nation," an unidentified Shabab leader told Agence France-Presse.

Some critics accused Kenyatta of stirring tension in a nation that has been deeply divided along ethnic lines, especially after postelection tribal violence in 2007 and 2008.

Others questioned whether the government was trying to distract from its failure to improve security after the myriad terrorist attacks that followed its 2011 invasion of Somalia in a military operation designed to improve national security and protect the valuable tourism industry.

The government announced Tuesday that it had deployed security forces in Nairobi slums and in western Kenya — the areas hit by the worst postelection violence — to prevent further attacks.

"We know there are plans to attack more innocent people in other parts of the country," Interior Minister Joseph Ole Lenku said.

Government and security officials in Lamu were replaced Tuesday, with Lenku describing the attacks as "an inside job."

"So our enemy is within us, not outside, and so we will not continue to look outside for the perpetrators when those responsible are inside," the minister said.

Residents of Mpeketoni jeered Lenku, furious about the failure to prevent the attacks and respond quickly to distress calls from residents, as the assault dragged on for hours.

"Why are they coming now after our people have been killed? Where were they to protect us?" said one angry resident who declined to give his name. "This government is full of talk and no action. They keep saying the country is safe and we keep suffering in the hands of terrorists."

Another resident, Omar Awadh Salim, 48, said the gunmen demanded that he and others recite the Islamic shahada, or profession of faith.

"Some just chatted and laughed, even as they pointed guns at us. I have never been so terrified," he said. The gunmen left after the residents were able to recite the declaration.

Kenya's coastal region has been the site of ethnic tension for many years, with indigenous populations angered by resettlement of Kenyans from other parts of the country in the 1970s, when about 30,000 members of Kenyatta's Kikuyu ethnic group were settled in Mpeketoni.