Fazıl Ahmed resumed his military campaign against the Habsburg Empire in May, but Montecuccoli inflicted a defeat on the Ottoman troops in the Battle of Saint Gotthard on 1 August 1664. Despite the victory, Leopold I did not want to risk a lengthy war against the Ottoman Empire and his deputies signed the Peace of Vasvár on 10 August. The peace treaty confirmed the Ottomans' territorial gains in return for a 22-year truce and Leopold I formally recognized Apafi's rule in Transylvania. The peace treaty also ordered the destruction of the westernmost Transylvanian fort, Székelyhíd.