In 1799, the Duke of Zweibrücken succeeded to the throne of the Electorate of Bavaria, and he kept Montgelas as his most trusted adviser. Montgelas was the inspirer and director of the policy by which in 1806 the Electorate was turned into a kingdom and was also greatly increased in size by the annexation of church lands, free towns, and small lordships, such as Wallerstein. As this end was achieved by undeviating servility to Napoleon, and by the most cynical disregard of the rights of Bavaria's German-speaking neighbors, Montgelas became the type of an unpatriotic politician in the eyes of all Germans who revolted against the supremacy of France. From his own conduct and his written defence of his policy, it is clear that such sentiments as theirs appeared to Montgelas to be merely childish.