During the Middle ages the castle belonged to the important Lordship Marburg with the old castle Obermarburg. In 1478, a second castle was built on the northeastern side of the town, today known as Maribor Castle. In 1480 and in 1481, Matthias Corvinus besieged the town but failed to conquer it on both occasions. In 1496, Maximilian I issued a decree to expel all Jews from Maribor and Styria. In 1515, the Maribor Town Hall was built and a few years later, in 1532, Maribor again came under siege, this time by the Ottoman Empire. In the battle that became known as the Siege of Maribor, a 100,000-strong Ottoman army under the leadership of Suleiman the Magnificent attacked the town, which was defended only by the local garrison and its citizens. Despite all the odds, Maribor was defended and the legend of the Maribor shoemaker who raised the sluice gates and flooded the Ottoman army is still popular today.