Al-Qaeda's North Africa branch claimed responsibility after six gunmen opened fire on civilians at an Ivory Coast beach resort, killing at least 16 people.

Bloody bodies were sprawled on the beach and witnesses described horrific scenes as a lazy Sunday afternoon was shattered by West Africa's latest attack.

Fourteen civilians and two special forces soldiers were killed before the six assailants were gunned down in the resort of Grand Bassam. Sunday's attack targeted three hotels in the southeastern town about 40km east of the country's economic capital, Abidjan.

Ivory Coast's President Alassane Ouattara arrived in Grand Bassam a few hours after the shooting rampage.

"I present my condolences to the families of the people who were murdered, and of course I am very proud of our security forces who reacted so fast," Ouattara said outside the Etoile du Sud, one of the targeted hotels. "The toll could've been much heavier."

Al-Qaeda in the Islamic Maghreb claimed responsibility, according to the SITE Intelligence Group.

Bursts of gunfire sent people running from the beach at Grand Bassam, a UNESCO World Heritage site and popular destination for Ivorians and foreigners.

It was the third major attack on a tourism centre in West Africa since November.

Some witnesses said the assailants fired at random, while others said the killing was more targeted. Witness Marcel Guy said gunmen raced across the beach in small groups, toting Kalashnikov rifles and hunting for victims.

One gunman, who had a long beard, approached two children on the beach and Guy said he heard the man speaking Arabic. One of the children then knelt and started praying. He was spared, while the other boy was not.

"The Christian boy was shot and killed right in front of my eyes," Guy said.

READ MORE: Deadly attack hits Ivory Coast tourist resort

Nii Akuetteh, an Africa policy analyst, told Al Jazeera security officials in the region would be closely watching the situation.

"African borders in general and in the Sahel in particular are pretty porous … I'm not surprised that they got all the way to the south of Ivory Coast. The prudent thing to do is to assume this will not be the last attack," said Akuetteh.

Dozens of people were killed in the earlier attacks on West African tourist sites, starting with a siege at a Malian hotel in November, and then an assault on a hotel and cafe in Burkina Faso in January.

Analysts had warned for months that Ivory Coast, which shares a border with both of those affected countries, could be hit as well.

"The United States strongly condemns the terrorist attack in Cote d'Ivoire in the Grand Bassam. We send our thoughts and prayers to all affected by this senseless violence," US Department of State spokesman John Kirby said in a statement.