AP

NAIROBI, Kenya (AP) — Dozens of Somali extremists wielding automatic weapons attacked a small Kenyan coastal town for hours, assaulting the police station, setting two hotels on fire, and spraying bullets into the street. At least 48 people were killed, officials said Monday.

The assault began around 8 p.m. local time on Sunday night as town residents were watching World Cup matches on TV. The attack met little resistance from the country's security apparatus, and lasted until early Monday morning.

Authorities blamed al-Shabab, Somalia's al-Qaida-linked terror group.

Kenya's top police commander, David Kimaiyo, said the death toll was 48. Another police commander said that as residents were watching the World Cup at the Breeze View Hotel, the gunmen pulled the men aside and ordered the women to watch as they killed them. The attackers told the women that that's what Kenyan troops are doing to Somalia men inside Somalia. The police commander insisted on anonymity because he was not authorized to share that detail of the attack.

A police spokeswoman said authorities believe that several dozen attackers took part.

The assault occurred in the town of Mpeketoni, which is about 30 miles (20 kilometers) southwest of the tourist center of Lamu. Any tourism in Mpeketoni is mostly local, with few foreigners visiting the region. The town is about 60 miles (100 kilometers) from the Somali border. Mpeketoni is about 360 miles (600 kilometers) from the capital, Nairobi.

Kenya has experienced a wave of gunfire and explosive attacks in recent months. The U.S., U.K., France, Australia, and Canada have all recently upgraded their terror threat warnings for the country. U.S. Marines behind sandbag bunkers are now stationed on the roof of the U.S. Embassy in Nairobi.

The Interior Ministry said that at about 8 p.m. Sunday two minivans entered the town. Militants disembarked and began shooting. Kenya's National Disaster Operations Center said military surveillance planes were launched shortly afterward.

The nearby town of Lamu is a UNESCO World Heritage Site and is the country's oldest continually inhabited town. The region saw a spate of kidnappings of foreign tourists in 2011 that Kenya said was part of its motivation for attacking Somalia. Since those attacks and subsequent terror warnings tourism has dropped off sharply around Lamu.

Al-Shabab has vowed to carry out terror attacks to avenge the Kenyan military presence in Somali. At least 67 people were killed in September when four al-Shabab gunmen attacked an upscale mall in the Kenyan capital, Nairobi. Kenya sent it troops to Somalia in October 2011.