Originally, the Archbishop of Mainz resided at the cathedral, where there is an old private chapel dating from 1137, but in 1475, when the Chapter re-elected Diether von Isenburg, conditions were imposed: he had to surrender the town of Mainz to the Chapter, and erect a castle in the city. The construction of this Martinsburg began in 1478 and was completed two years later. For several decades, the archbishops lived either there or in the electoral palace at Aschaffenburg, Schloss Johannisburg. After receiving damage during the second war with the margraves in 1552 the castle was restored in a Renaissance style. Archbishop Daniel Brendel von Homburg built office buildings and St Gangolph's Church around the year 1580. (In order to make way for new avenues, these buildings as well as the Martinsburg were demolished by Napoleon during the French occupation of the town between 1798 and 1814.)