died in 1264 without male issue. Rudolph I, Count of Habsburg and later King of the Romans, placed the heir, Anna of Kyburg, under his protection and she later married Eberhard I of Habsburg-Laufenburg. In 1273 Rudolph took possession of the estate from his impoverished relatives and in 1275 held court there. However, the castle then declined into a regional seat of government, as the power of the Habsburgs shifted more and more to Austria. On 20 August 1306, Lenzburg received its charter as a town from Count Frederick the Fair. From 1339 on, Count Frederick II of Tyrol-Austria resided at the castle. He was to have married a daughter of King Edward III of England and had the Knights' Hall built for the purpose, but died in 1344 without ever seeing his bride, and the building remained incomplete. After 1369, the Schultheiss-Ribi family were tenants of the castle. In 1375 the castle underwent a siege by the Gugler. Bernese rule The latent tensions between Sigismund, King of Germany and Frederick IV, Duke of Austria exploded in 1415 at the Council of Constance, when Frederick assisted one of the three then reigning popes, Antipope John XXIII, in escaping from the town. Sigismund took the opportunity to harm his opponent, ordering his neighbours to seize his lands in the name of the Empire. Bern willingly conquered the western part of the Aargau. The town of Lenzburg immediately surrendered to the advancing army on 20 April, but the castle for the moment remained untouched by the conflict. Konrad of Weinsberg, the king's representative, attempted to secure it for the Empire and had it prepared for a siege. But by August he saw the futility of this plan and in 1418 returned the castle to the control of the Schultheiss family. After lengthy negotiations, Bern was able to secure control of the County of Lenzburg as subtenants in 1433 and finally in 1442 of the castle. The first Bernese Landvogt took up residence in the castle in 1444, governing the district of Lenzburg from there. The duties of a Landvogt included collecting taxes, implementing administrative measures, judicial and police tasks and the power of military decree; they were also responsible for the upkeep of the castle. The Landvogt was elected from the ranks of the city council of Bern for four-year terms. The best known Landvogt of Lenzburg was Adrian I of Bubenberg,