were built into the old rampart and a stone wall was added around the castle proper (i.e. the residential building). The biggest of the rampart towers was at the same time a corner tower of the stone wall. Today it is a part of the castle building — it is identical with the present-day "Crown tower", which is the largest of the four existing towers of the structure. It was probably built around 1250 when Knights of St. John were active at the castle. On 25 October 1265 the Czech King, Přemysl Otakar and the Hungarian King Béla IV.'s grandchild Kunigunde, were engaged here. Andrew II and Gertrude's daughter, Elisabeth was born here. The new castle faced further conflicts. In 1271, King Otakar II of Bohemia invaded the territory of today's western Slovakia and charged the knight Egid with the administration of the conquered castle. Egid rebelled against Otakar two years later and was defeated by Otakar, but due to problems in Bohemia, Otakar had to leave this territory. In 1285-86, the noble Nicholas Kőszegi occupied the castle in order to use it as a basis for a rebellion against the Hungarian king, but he was defeated. Shortly afterwards, 1287–1291, the Austrian duke Albert of Habsburg, supporting Nicholas, occupied the castle, but was defeated by Matthew III Csák, who was made county head of Pozsony county for this. A more or less successful Austrian occupation of the castle and the county occurred in 1302-1312/1322 by Duke Rudolf. As a result of these permanent fighting, the Hungarian king granted the city rights (town charter) to a part of the settlements below the castle in 1291, thereby withdrawing them from the authority of the county head in the castle. Some settlements on the castle hill remained under the castle's authority and the fortification was gradually extended to them. In 1385, King Sigismund of Luxembourg occupied the castle and Pozsony county and one year later put the county in pawn to his cousins, the Moravian margraves Prokop and Jošt in exchange for a loan they provided to him. The castle was reconquered by Stibor of Stiboricz in 1389, who was made the county head of the Pozsony county in 1389-1402 as a reward. He had a chapel built in Bratislava Castle. Another ally of King Sigismund, especially in his fights against the Czech Hussites, was the noble family Rozgonyi, which received the Pozsony