(a) The mayor of a borough or first class city is elected at large. The mayor of a borough or first class city serves a term of three years, unless by ordinance a different term not to exceed four years is provided. The current term of an incumbent mayor may not be altered. The regular term of a mayor of a borough or first class city begins on the first Monday following certification of the election.
(b) The mayor of a second class city is elected by and from the council, and serves until a successor is elected and qualifies. The council of a second class city shall meet on the first Monday after certification of the regular election and elect a mayor who takes office immediately. The mayor of a second class city serves a one-year term, unless a longer term is provided by ordinance. The mayor of a second class city may serve only while a member of the council regardless of the term established for the office of mayor.
(c) Except by ordinance ratified by the voters, no limit may be placed on the total number of terms or number of consecutive terms a mayor may serve.
(d) Notwithstanding (b) of this section, a second class city may by ordinance provide that the mayor is elected, from the council, by the voters rather than by the council. If an ordinance is adopted under this subsection, the council shall meet on the first Monday after certification of each regular election and elect a council member to serve as mayor pro tempore who takes office immediately and exercises the powers and duties of mayor until the permanent mayor takes office. Within 45 days after certification of a regular election, a special election shall be held for the permanent mayor. The permanent mayor takes office on the first Monday following certification of the special election and serves until the first Monday after certification of the next regular election. The term of a mayor in office on the effective date of an ordinance adopted under this subsection may not be altered.