A Reuters witness saw customers running out of the Aziz Istanbul restaurant in central Ouagadougou as police and paramilitary gendarmerie surrounded it amid gunfire.
"This is a terrorist attack," Communications Minister Remi Dandjinou told a news conference. He said the toll was provisional because the security operation was still underway.
Read alsoRFE/RL: Militants attack Iraqi Embassy in KabulBurkina Faso security forces killed three suspected jihadists but there were still people trapped inside the building, he said later on state TV.
Burkina Faso, like other countries in West Africa, has been targeted sporadically by jihadist groups operating across Africa's Sahel. Most attacks have been along its remote northern border region with Mali, which has seen attacks by Islamist militants for more than a decade.
Thirty people were killed when gunmen attacked a restaurant and hotel in Ouagadougou in January 2016 in an incident claimed by al Qaeda in the Islamic Maghreb (AQIM).