A hostage situation was under way at the Pizza House restaurant, said Captain Mohamed Hussein.
Mr Hussein had no immediate information about any casualties.
The Somalia-based extremist group al-Shabab often targets high-profile areas of Mogadishu, including hotels, military checkpoints and areas near the presidential palace.
It has vowed to step up attacks after the recently elected government launched a new military offensive against it.
Al-Shabab last year became the deadliest Islamic extremist group in Africa, with more than 4,200 people killed in 2016, according to the Washington-based Africa Centre for Strategic Studies.