All officers of a city of the first class appointed by the mayor and confirmed by the city council shall hold the office to which they may be appointed until the end of the mayor's term of office and until their successors are appointed and qualified, unless sooner removed or the ordinance creating the office is repealed, or as otherwise provided by law.