If a vacancy occurs in the office of mayor, the city council may call a special city election to fill such vacancy for the unexpired term or may, after fifteen days from the date of such vacancy, elect one of its members to act as mayor. The member so elected shall possess all the rights and powers of the mayor until the next election and until a mayor is elected and qualified. Upon petition of five percent of the qualified electors, as determined by the total number of votes cast in the city in the last city general election, the council shall call a special election to fill a vacancy occurring more than six months prior to the next city election, provided such petition is submitted within fifteen days of the date of such vacancy. During the interim between the date when a vacancy occurs in the office of mayor and election and qualification of a successor, the president of the city council shall be the acting mayor.