Mergentheim Palace (Deutschordensschloss von Mergentheim) is a historic building located in Bad Mergentheim, Germany. The palace was first a castle, built in the early Middle Ages as the seat of the , but then became a Teutonic possession in 1219, and then seat of the . The castle became the residence of the Grand Master of the Teutonic Order in 1527 and remained the headquarters of the Order until 1809. History The history of Mergentheim Palace begins in the 12th century, when the Counts of built a castle on the east side of a village called Mergintaim. This castle was then obtained by the House of Hohenlohe, who began expanding it in 1169. In 1219 the master of the castle, Andreas von Hohenlohe, joined the Teutonic Knights with two relatives and donated Mergentheim to the Order. This transfer to the was presided over by , Bishop of Würzburg, and confirmed by Frederick II, Holy Roman Emperor. The Teutonic Knights were given extensive rights in and over Mergentheim, including the limiting of the citizenry's ability to make legal appeals to the local courts, by Louis IV, Holy Roman Emperor in 1340. By the 15th century, the Teutonic outpost at Mergentheim had 19 knights, four of whom were ordained priests. On 26 March 1524, the citizens of Mergentheim, participating in the German Peasants' War, rose in revolt to the Teutonic Order and sacked one of their properties in the town. The gates to the town were opened to the peasants of the Tauber valley on 6 April, whereupon more looting took place and the castle was occupied. The residence of the German Master, Horneck Castle, was also attacked by Swabian peasants in 1525 and destroyed. Meanwhile, the Teutonic state in Prussia was secularized by the Kingdom of Poland. In response to the loss of Horneck Castle, the Franconian bailiwick offered Mergentheim as a residence to the German Master, Walter von Cronberg, in 1527. Cronberg accepted and that year combined the offices of the German Master and Grand Master of the Teutonic Order, making Mergentheim the headquarters of the entire Order. This arrangement was provisional until the loss of Prussia became inexorable with the destruction of the Livonian Order in 1561, obliging the Grand Master to remain in Mergentheim. 17 Grand Masters would govern the Order and its territories from Mergentheim until the Order was expulled from the town in 1809. Headquarters of