Somali jihadists have massacred dozens of people who congregated to watch the World Cup in a Kenyan coastal resort, setting fire to two hotels and ordering women to watch as their husbands and sons were murdered.

The attack comes as a state in Nigeria, another African country plagued by terror threats, banned all public viewings of matches from the 2014 World Cup in Brazil amid fears they would be targeted by Boko Haram terrorists.

Men look at the wreckage of two vehicles sitting on the roadside in Mpeketoni, in Lamu county along the Kenyan coast

Kenyan locals and tourists had congregated to watch the football on Sunday night in the bar of the Breeze View hotel in the town of Mpeketoni at around 8pm when the Al-Shabab gunmen stormed the building, spraying bullets into the air. Around 50 people are believed to have been killed according to AP who quoted Kenya's top police commander, David Kimaiyo.

The interior ministry said two minivans entered the town and started shooting, with officials blaming Somali militants from al-Shabab. The attackers pulled the men from the group and shot them, telling the women that's what Kenyan troops are doing inside Somalia.

People gather near the body of a man lying in the street in Mpeketoni, in Lamu county along the Kenyan coast

A police spokeswoman said authorities believe that several dozen attackers took part in the attack just 30 miles southwest of the tourist centre of Lamu, a UNESCO World Heritage Site. Kenya's National Disaster Operations Center said military surveillance planes were launched afterward.

Tourism in Mpeketoni is mostly local, with few foreigners visiting the region.

Kenya may now be forced to take similar steps to its fellow African nation Nigeria, where the threat of terrorist attacks from Boko Haram means most will be denied the chance to witness their team’s performance live.

For many in the north-eastern state of Adamawa, the open air screenings were the only way they would have been able to watch their team take on Iran, Bosnia-Herzegovina and Argentina.