TWO nights of terror attacks on Kenya’s coast on June 15th and 16th left at least 65 people dead, prompting the Shabab, a Somali militia of extreme Islamists, to boast that it had turned the country into a “war zone”. The killings mark a change of gear. Previously the group has mainly committed sporadic acts of cross-border terror. Its latest massacres come closer to resembling a domestic insurgency. Yet Kenya’s president, Uhuru Kenyatta, seems to be blaming his political opponents at home for encouraging the violence.

The attacks began at night, when dozens of gunmen struck Mpeketoni, a grubby town on the mainland across from Lamu, an island that is popular among Westerners. Some 50 locals were slaughtered. Many were said to be fellow Kikuyus of Mr Kenyatta. Witnesses spoke of militants flying the banner of the Shabab and targeting non-Muslims. While the authorities scrambled to respond, the Shabab carried out another wave of attacks nearby the next night, adding 15 more to the death toll. Some reports suggested that a dozen women had been kidnapped.

The attacks echo those perpetrated by Boko Haram, the extreme Islamist insurgents in northern Nigeria, whose large-scale raids and the abduction of women and girls have grabbed international headlines and humiliated the government.

In the aftermath of the attacks on Mpeketoni, the Shabab achieved both aims. Kenya’s tourism, which has provided 15% of GDP in recent years, is in tatters. Warnings last month by the British and other foreign governments prompted flustered tour companies to evacuate clients from Kenya’s coastal tourist hub, Mombasa. The luxurious resorts and hotels on Lamu island stand virtually empty. Operators admit it could take years to restore confidence.

The response of Kenya’s government has baffled observers as much as the slaughter has shocked them. After nearly two days of silence, Mr Kenyatta declared on June 17th that the Shabab was not involved. Instead he blamed the attacks on “local political networks”, in an apparent effort to deflect hostility onto his domestic opponents at a time of rising tension between his ruling Jubilee coalition and the main opposition, which he narrowly defeated in an election a year ago. “The attack in Lamu was well-planned, orchestrated, and politically motivated ethnic violence against a Kenyan community, with the intention of profiling and evicting them for political reasons,” he said. “This therefore, was not an al-Shabab terrorist attack.” The implication was that the opposition was keen to see Kikuyus targeted.

Mr Kenyatta has so far ignored the demands of the opposition, the Law Society of Kenya and other influential organisations to fire Joseph Ole Lenku, his interior minister. No high-level officials have been sacked as a result of the disastrous handling of September’s assault by the Shabab on the Westgate Centre, a smart shopping mall in the capital, Nairobi, when at least 67 people were killed.

Since then the Somali militants have switched to softer targets, such as commuter buses and open-air markets. This has left the government open to accusations of not caring about ordinary Kenyans, a claim that wins a sympathetic hearing especially among Kenya’s impoverished coastal people, most of whom are Muslim.

The Shabab says its campaign is a response to the continuing presence of Kenyan troops in southern Somalia, where they have occupied the port city of Kismayo and its surroundings since invading in 2011 in an effort to defeat the group, which still controls swathes of Somalia. It also says that the latest attacks are an answer to three recent drive-by shootings of prominent radical preachers in Mombasa. Local human-rights groups allege that the imams died in extra-judicial killings arranged by the authorities, a charge the Kenyan government denies. In any event, this wave of violence, together with the disenchantment of coastal people and the apparent eagerness of the ruling class to exploit ethnic and religious divisions, is gravely threatening Kenya’s stability.