In the High and Late Middle Ages, the town was the main producer of silver and gold in the Kingdom of Hungary. During the Ottoman Wars, the Turks made concerted efforts to conquer rich mining towns in Upper Hungary (Banská Štiavnica, Banská Bystrica, and Kremnica). This new threat led Banská Štiavnica to build powerful fortifications, including two castles, in the 16th century. As one of the most important centers of the Protestant Reformation in the country, the town belonged to the Protestant "League of Seven Mining Towns" together with Banská Belá, Banská Bystrica, Kremnica, Ľubietová, Nová Baňa, and Pukanec.