"The mayor was wounded in the blast and he is currently being treated," Mohamed Abdullahi Tulah, deputy mayor, told state-owned Radio Mogadishu.
Officials also informed that commissioners of the Mogadishu district were killed.
"Six people, including two district commissioners and three directors, were killed in the terrorist attack this afternoon," officials told reporters, while other six people were wounded, among them Osman.
"The blast was very heavy, and I saw people, fleeing some with shrapnel wounds outside the Banadir administration headquarters," Mohamud Sharif, a witness, told AFP.
The armed group Al-Shabab, claimed responsibility for the assault. Al-Shabab is an Al-Qaeda-linked armed group whose objective is to overthrow the current Western-backed government. They regularly stage attacks against the Somali military, and against troops from the African Union-mandated peacekeeping force AMISOM.
1) BREAKING: #Shabaab claims assassination attempt on UN Special Envoy to Somalia James Swan, an American national, via bombing in #Mogadishu. Group says Swan survived but multiple government officials were killed and wounded, including Mogadishu's mayor.
Earlier on the day, United Nations special envoy James Swan had met with the mayor at the headquarters of the Banadir district, which encompasses Mogadishu, according to the mission's Twitter account, however, he left before the explosion.
It remains unclear how the suicide bomber managed to enter the mayor's office or what officials were attending the security meeting.