The Somalia-based armed group al-Shabab has said it carried out a deadly attack on a town in Kenya in which 48 people were killed and several buildings burned down.

In a statement sent to Al Jazeera on Monday, the group said that the attacks would continue, adding that the Kenyan government was "fighting a losing war" and telling tourists to stay away.

The group said they targeted the coastal town of Mpeketoni on Sunday because it was originally a Muslim area that was "invaded and occupied by Christian settlers".

"The prospect of peace and stability in Kenya will be but a distant mirage," the statement said. "Brace yourself for the depredations of war and that which you have with your hands sown."

Al Jazeera's Rawyah Rageh, reporting from Mpeketoni on Monday, said that residents were "shocked" about how the attack lasted for hours, with the gunmen fleeing with minimal resistance.

Sunday's attack in Kenya's tourist hub was the biggest since the deadly Westgate Mall raid last September in the capital Nairobi.

Kenya's Interior Minister Joseph Ole Lenku promised on Monday to pursue the attackers.

Attack on foreigners

Al Jazeera's Rageh said the attack did not target foreigners in Kenya.

"Attacks frequently carried out by al-Shabab target foreigners, but the latest one targeted locals in a small town," she said.

Kenya sent troops into Somalia in late 2011, after al-Shabab fighters carried out a series of raids on Kenyan soil.

Al-Shabab, which has fought a seven-year campaign to impose its interpretation of Islamic law inside Somalia, has said it wants to take revenge for Kenya's deployment of troops in the Horn of Africa nation.

"The Mpeketoni raid was carried out in response to Kenyan military's continued invasion and occupation of our Muslim lands and the massacre of innocent Muslims in Somalia."

Kenya has experienced a drop in tourist arrivals in recent months following gun and grenade attacks blamed on al-Shabab or its sympathisers.

In May, explosions in Nairobi and the coastal city of Mombasa led the UK, US, France and Australia to issue warnings about travel to Kenya, and at least 400 tourists cut short their holidays and left hotels along the Indian Ocean coast.

Kenya called the alerts "unfriendly", saying they would increase panic and play into the hands of those behind the assaults.