Zekra Alwach, a civil engineer and director general of the ministry of higher education, becomes the first female to be given such a post in the whole country, where international rights groups have condemned women's rights abuses.
As mayor -- the most important administrative position in the capital -- Alwach will deal directly with Prime Minister Haider al-Abadi and holds has the prerogatives of a cabinet minister.
She will begin work tomorrow, according to a municipal source.
Aboub's removal was not designed as a punishment, although he was regularly accused on social media and by Baghdad residents as incompetent, the spokesman added.
Also Read
He made headlines in March 2014 when he described his city, beset by brutal sectarian violence and rife with corruption, as "more beautiful than New York and Dubai".
"Aboub is a clown. Abadi should have sacked him from the start," said Yasser Saffar, a Baghdad baker. "All his statements were ridiculous."
Alwach's appointment is a breakthrough for gender equality in Iraq, where rights groups say discrimination and violence against women is widespread.
Baghdad is currently plagued by car bombings and sectarian killings, and militants from the Islamic State group have seized much of Anbar province to the west, menacing the capital.