Assailants opened fire on beachgoers in Grand-Bassam, a historic resort town in Ivory Coast sending tourists fleeing through hotels.
Photos posted to social media apparently taken at the scene showed bodies sprawled on the beach.
Ivory Coast's President Alassane Ouattara says that 14 civilians and six assailants were killed. Security forces responded as the area evacuated and residents hid in their homes.
A group that monitors jihadist websites says that Al-Qaeda in the Islamic Maghreb has claimed responsibility for the attack.
Site Intelligence Group said the Islamic extremist group made the declaration in a post to its Telegram channels, calling three of the attackers "heroes" for the assault.
The Government says security forces killed six armed men after attacks on three hotels and security sweeps are underway.
The bursts of gunfire were heard in the southeastern Ivory Coast beach town about 40km east of Abidjan, Ivory Coast's commercial centre, said a witness, the third major attack on a tourism centre in a West African country since November.
The gunfire rang out from the beach said 25-year-old Josiane Sekongo, who lives across from one of the town's many beachfront hotels. People ran from the beach amid the gunfire, she said.
Security forces responded as residents hid in their homes, she said. Grand-Bassam is a Unesco world heritage site and a popular weekend destination for Ivorians and foreigners.
A receptionist at the Etoile de Sud hotel in Grand-Bassam said the attacks happened on the beach.
"We don't know where they came from, and we don't know where they've gone," he said of the gunmen. Everyone in the hotel was safe, and gendarmerie were present, he said. He would not give his name.
The attack marks the third time in recent months that a West African tourist center has come under assault by gunmen.
Dozens were killed in the earlier attacks, starting with a siege at a Malian hotel in November and then an assault on a hotel and cafe in Burkina Faso in January.