In June 1697 Mustafa II left the capital on his third military campaign against the Habsburg Empire. However, the Ottoman Army suffered a defeat in the Battle of Zenta and Grand Vizier Elmas Mehmed Pasha died in the battle. Afterwards the Ottomans signed a treaty with the Holy League.