The horrific Thirty Years' War devastated the Bailiwick, resulting in the deaths of many knights and the destruction of much of the wealth of the Bailiwick. By the terms of the Peace of Westphalia ending the conflict, the Bailiwick was effectively placed under the protection of the Prince Electors of Brandenburg, later Kings of Prussia, members of the House of Hohenzollern. Under this protection, the "Johanniterorden", as the Order came to be known, came to be headquartered at Sonnenburg Castle in the Neumark of Brandenburg, east of the Oder River, though the "Herrenmeister" resided in the Ordenspalais in Berlin from its completion in 1738.