King Stephen ordered the building of a castle at Moson to defend the border in the early 11th century. Settlers flocked around the wooden and then stone castle, and by the 11th century it was described as a strong fortress and bustling merchant town. However, in 1030, the Holy Roman Emperor Conrad II was able to conquer the castle on his way to the Rába. During the Crusades, Kálmán, King of Győr and Moson, was able to defeat a Swabian-Bavarian army of 15,000 men from the castle. The next disaster occured in 1271, when Ottokar II, a Czech king, leveled the castle.
Béla IV, King of Hungary at the time, did not consider it worthwhile to try and rebuild the castle at Moson. After the fall of Győr to the Ottoman army in 1594, the castle was modernized to withstand a possible future attack by Italian engineers.
In 1683, the new castle was helpless against the retreating Turkish army, which had been repulsed again at Vienna. Both Moson and Magyaróvár were set ablaze. Though the town archives were now completely destroyed, the damage was repaired more quickly this time around, at least quickly enough to allow Rákóczi to use the castle as a base during his war for independence from the Habsburgs. In 1721, after the revolution was crushed, the castle at Magyaróvár lost its strategic importance, and all military materiel was transferred to Bratislava.
References:The Gravensteen is a castle in Ghent originating from the Middle Ages. The name means 'castle of the counts' in Dutch. Arnulf I (918–965), Count of Flanders, was the first to fortify this place, building a medieval bastion on this high sand dune, naturally protected by the river Leie and its marshy banks. This bastion consisted of a central wooden building and several surrounding buildings, also in wood.
In the early 11th century, the wooden building was replaced by a stone residence, consisting of three large halls that made up three storeys, connected by a stone stairwell. The monumental stone staircase, the light openings, the fireplaces built into the walls and the latrines were signs of considerable luxury and comfort in those days. There was probably also a tower.