The monarchs of Prussia were members of the House of Hohenzollern who were the hereditary rulers of the former German state of Prussia from its founding in 1525 as the Duchy of Prussia. The Duchy had evolved out of the Teutonic Order, a Roman Catholic crusader state and theocracy located along the eastern coast of the Baltic Sea. The Teutonic Knights were under the leadership of a Grand Master, the last of whom, Albert, converted to Protestantism and secularized the lands, which then became the Duchy of Prussia. The Duchy was initially a vassal of the Kingdom of Poland, as a result of the terms of the Prussian Homage whereby Albert was granted the Duchy as part of the terms of peace following the Prussian War. When the main line of Prussian Hohenzollerns died out in 1618, the Duchy passed to a different branch of the family, who also reigned as Electors of Brandenburg in the Holy Roman Empire. While still nominally two different territories, Prussia under the suzerainty of Poland and Brandenburg under the suzerainty of the Holy Roman Empire, the two states are known together historiographically as Brandenburg-Prussia. Following the third Northern War, a series of treaties freed the Duchy of Prussia from vassalage to any other state, making it a fully sovereign Duchy in its own right. This complex situation (where the Hohenzollern ruler of the independent Duchy of Prussia was also a subject of the Holy Roman Emperor as Elector of Brandenburg) laid the eventual groundwork for the establishment of the Kingdom of Prussia in 1701. For diplomatic reasons, the rulers of Prussia called themselves King in Prussia from 1701 to 1772. They still nominally owed fealty to the Emperor as Electors of Brandenburg, so the "King in Prussia" title (as opposed to "King of Prussia") avoided offending the Emperor. Additionally, calling themselves "King of Prussia" implied sovereignty over the entire Prussian region, parts of which were still part of Poland. As the Prussian state grew through several wars and diplomatic moves throughout the 18th century, it became apparent that Prussia had become a Great Power in its own right. By 1772, the pretense was dropped, and the style "King of Prussia" was adopted. The Prussian kings continued to use the title "Elector of Brandenburg" until the end of the Holy Roman Empire in 1806, reflecting the legal fiction that their domains within the empire were