(a)
(1) Mayors in cities of the first class and second class and incorporated towns shall have the power to appoint and remove all department heads, including city and town marshals when an ordinance has been passed making city and town marshals appointed, unless the city or town council shall vote by a two-thirds majority of the total membership of the council to override the mayor's action.
(2) Provided, however, that in cities of the first class and second class with civil service commissions, the governing body of the city may delegate by ordinance the authority to appoint and remove the heads of the police and fire departments to the city's civil service commission.
(b) City managers in cities having a city manager form of government shall have the power to appoint and remove all department heads. In cities with a city manager form of government and with civil service commissions, the civil service commission shall have the power to override the city manager's appointment or removal of the police or fire chief by a majority vote of the total membership of the commission.
(c) The provisions of this section shall not apply to department heads not under the control of the governing body of the city and shall not apply to cities having a city administrator form of government.