(CNN) The United States and France have pledged assistance to Ivory Coast as the West African nation investigates a terror attack that left at least 16 people dead.

Gunmen stormed three hotels Sunday in the beach resort city of Grand-Bassam, officials said. Foreign nationals, including a Frenchman and a German woman, were among the dead.

Al Qaeda in the Islamic Maghreb claimed responsibility on a social media account tied to the group.

Two soldiers and 14 civilians were among those killed, President Alassane Ouattara said as he visited the sites of the attack.

Three terrorists were killed in the attack, the Ivory Coast presidency said on its Facebook page Monday, citing Interior Minister Hamed Bakayoko.

On Sunday, Ouattara gave the number of terrorists killed in the attack as six. No information was immediately available Monday clarifying the discrepancy.

The President declared three days of national mourning. He urged the Ivorian people to come together and to not give in to fear.

"I condemn in the strongest terms these heinous and cowardly attacks on innocent people," he said. "Ivory Coast will not be intimidated by terrorists."

CNN Map

Popular weekend spot targeted

The attack began shortly after midday Sunday when the beach at Grand-Bassam -- about 40 kilometers (25 miles) from the country's largest city, Abidjan -- reportedly was packed with people swimming, relaxing and eating at beachside cafes. The area is popular with wealthy Ivorians and Westerners, particularly on Sundays.

Eyewitnesses told CNN they heard sustained gunfire for about 15 minutes and saw people running and screaming from the three hotels.

"Truly, truly it was terrifying," said Yapi Marie Claire, who witnessed the attack. "We never thought it could happen here under these circumstances. It's truly not easy. It's not easy."

Describing a gunman, Kouakou Bertin said, "He shouted, 'Allahu akbar,' " Arabic for God is great. "At that moment three others arrived and started to shoot."

Photos posted by Twitter user @lopezdobe showed ammunition magazines and grenades on the ground near the scene.

#Urgent : Attaques sur une plage a #Bassam à 40 km d'#Abidjan. équipements oublié sur place par les terroristes. pic.twitter.com/ymTUIzz5yA — Lopez Dobe (@lopezdobe) March 13, 2016

Colleagues mourn German woman

Among the victims was German Henrike Grohs, 51, director of the local German cultural association in Abidjan, Ivory Coast's capital.

In a statement, Goethe-Institut President Klaus-Dieter Lehmann said it was terrible "that a woman who campaigned for a meaningful life with all her strength had to die so senselessly."

Grohs had been in Ivory Coast since 2013. Before then she had worked for the Goethe-Institut in Johannesburg and earlier the Berlin Philharmonic, the statement said.

Johannes Ebert, the institute's secretary-general, said in a statement that Grohs' colleagues were stunned that she had been "snatched so tragically and cruelly from life."

"She loved her work and was full of ideas, and full of energy to implement these ideas," he said.

Attack condemned

The United Nations joined the U.S., French, German and other governments in denouncing the attack.

French President Francois Hollande said that at least one French citizen was killed in the "cowardly attack."

The White House also condemned it "in the strongest terms," National Security Council spokesman Ned Price said.

The United States and France have pledged their support to the Ivorian government to find out who was responsible.

The U.S. Embassy in Abidjan reported it had no evidence that U.S. citizens were targeted or harmed.

The French Embassy said it had set up a crisis unit and asked people to limit travel in the area and stay clear of security forces. The British Foreign Office had similar advice.

Photos: Gunmen attack Ivory Coast hotels Armed gunmen opened fire at a hotel in Grand-Bassam, Ivory Coast, on Sunday, March 13. Al Qaeda in the Islamic Maghreb has claimed responsibility for deadly attacks on three Grand-Bassam hotels. Hide Caption 1 of 12 Photos: Gunmen attack Ivory Coast hotels A man stands between bodies on a beach after the terror attack. Hide Caption 2 of 12 Photos: Gunmen attack Ivory Coast hotels A body is loaded into a van after the attack. Hide Caption 3 of 12 Photos: Gunmen attack Ivory Coast hotels Ivorian soldiers stand around a boy who was injured. Hide Caption 4 of 12 Photos: Gunmen attack Ivory Coast hotels A man covers the body of a victim. Hide Caption 5 of 12 Photos: Gunmen attack Ivory Coast hotels People carry bodies following the shooting rampage. Hide Caption 6 of 12 Photos: Gunmen attack Ivory Coast hotels An Ivorian soldier carries a machine gun as he walks on the beach. Three terrorists also were killed, the Ivory Coast presidency said on its Facebook page, citing Interior Minister Hamed Bakayoko. Hide Caption 7 of 12 Photos: Gunmen attack Ivory Coast hotels People cover the body of a victim. Hide Caption 8 of 12 Photos: Gunmen attack Ivory Coast hotels A photo taken by a witness to the attack shows a woman's body on the beach. Hide Caption 9 of 12 Photos: Gunmen attack Ivory Coast hotels Ivorian forces transport civilians to safety. Hide Caption 10 of 12 Photos: Gunmen attack Ivory Coast hotels Ivory Coast President Alassane Ouattara, left, speaks to the country's chief of staff, Gen. Soumaila Bakayoko. Hide Caption 11 of 12 Photos: Gunmen attack Ivory Coast hotels Ivory Coast's armed forces take position outside one of the hotels. Hide Caption 12 of 12

Al Qaeda offshoot was behind other hotel attacks

Sunday's violence was the third major attack on hotels in West Africa claimed by Al Qaeda in the Islamic Maghreb since November.

JUST WATCHED Who are Africa's most dangerous terror groups? Replay More Videos ... MUST WATCH Who are Africa's most dangerous terror groups? 01:55

Al Qaeda in the Islamic Maghreb, al Qaeda's North African offshoot known as AQIM, has its roots in Algeria. The group has been stepping up attacks after a downturn in activities.

Ryan Cummings, director at Signal Risk, an Africa-focused risk management company, said the recent attacks were evidence of a resurgence.

"They've executed attacks on hotels before, but none at the level of sophistication or as spectacular as have been in recent months," he said.

He said the chosen targets reflected the group's pronounced "anti-French" focus.

"They're almost ticking off major hotels within Francophone West Africa, specifically hotels that are quite popular with French citizens," he said.

Targeting French interests had been a priority for the group since France launched, at Mali's request, Operation Serval , a U.N.-sanctioned ground and air operation against jihadists in 2013. It was succeeded in August 2014 by Operation Barkhane, a broader French anti-terror mission targeting Islamists in the Sahel, with a 3,000-strong force headquartered in Chad.

While Serval was successful against Islamist militants in Mali, subsequent operations have been less effective, allowing militants across the region to reconsolidate, he said.

The SITE Intelligence Group, which tracks jihadist organizations, said in an analysis of Sunday's attack that AQIM had "escalated its operations in West Africa, specifically targeting Europeans, as well as other foreigners, in hotels and resorts."

But targeting Westerners isn't the only goal, according to SITE.