Following this treaty, he concentrated on the Cretan War and captured Candia (present-day Heraklion) from the Republic of Venice in 1669. At the end of the Polish–Ottoman War (1672–1676) against the Polish–Lithuanian Commonwealth, he signed the Treaty of Buchach in 1672 and the Treaty of Żurawno in 1676.