He subsequently became governor of Damascus and, in 1589, after the great revolt of the Janissaries, was appointed grand vizier for the second time. He was involved in the competition for the throne in Wallachia between Mihnea Turcitul and Petru Cercel, and ultimately sided with the former (overseeing Petru's execution in March 1590). Another revolt of Janissaries led to his dismissal in 1591, but in 1593 he was again recalled to become grand vizier for the third time, and in the same year he commanded the Ottoman army in the Long War against the Habsburgs, he was faced with massive casualties on the northern front, which was weakened by the death of Bosnian commander Telli Hasan Pasha during the Battle of Sisak. In 1593, he captured Veszprém and Palota after a 3-4 days of siege and turned his attention to the Sisak, where Telli Hasan Pasha and Ahmed Pasha had died. He soon captured Sisak and came back to Belgrad.