The old palace, which was built in the Renaissance style in the 16th and early 17th centuries, was largely destroyed in a fire in 1753 and replaced as a residence by the new palace in the following years. However, it was largely rebuilt, with some changes in use. Two representative residences for high-ranking Margravial officials were built in place of the north wing.
A palace chapel had probably been located in the east wing for a long time. In 1665, under Margrave Christian Ernst, a new (and probably larger) palace church was built after the stables were relocated.
When the construction of a new residence was considered after the fire in 1753, it was decided to rebuild the court church on its old site. It was also to serve as the burial place of the Margrave couple. The church was ceremoniously inaugurated at Easter 1758. In October of the same year, Wilhelmine of Bayreuth, the eldest sister of Frederick the Great, who was also active as a writer and composer, died and was buried in the church's above-ground crypt. In 1763, Frederick III followed her, and when the bell in the castle tower was rung for the first time, it shattered with a loud bang.[4] In 1780, the couple's only daughter, Elisabeth Friederike, was buried there.
After the last Margrave, Karl Alexander, renounced the principalities of Ansbach and Bayreuth in December 1791, his territories became a Prussian province. With the end of the Margraviate, the church lost its function and was temporarily used as a weapons depot.