It withstood several sieges (including one by the Ottomans in the 16th century) but was never captured. It suffered its greatest destruction in 1713, when Austrian imperial troops set fire to it after an uprising (the Rákóczi War of Independence) to prevent it from falling into the hands of the rebels. Afterward, it fell into ruin.