DAKAR, Senegal — At least 18 people were killed in Burkina Faso when gunmen stormed a popular cafe and sprayed diners with bullets, including a family celebrating a 9-year-old’s birthday, the authorities said Monday.

The assault on Sunday evening in Ouagadougou, the capital, was eerily similar to an attack in January 2016, when gunmen killed dozens of people at a hotel and a restaurant on a busy weekend evening. Islamist extremists were blamed, and some experts believed the same groups were behind the assault on Sunday as well.

Officials said the gunmen in Sunday’s attack arrived at the Aziz Istanbul cafe by motorcycle around 9 p.m., and first opened fire on patrons in an outdoor area before moving inside.

Capt. Guy Hervé Yé, a military spokesman, said that at least two assailants had been killed.

Hyacinthe Sanou, a journalist in Ouagadougou who visited the scene shortly after the attack, said a family had been in the restaurant celebrating the birthday of their 9-year-old son. The boy was struck by a bullet and has been hospitalized.