During the decisive Battle of Petrovaradin on 5 August 1716, the grand vizier Silahdar Ali Pasha was killed. Upon the suggestion of the commanders, the sultan appointed Halil Pasha as the new grand vizier. Next year he campaigned to aid Belgrade, which was being besieged by the Austrian army. However Eugene of Savoy of Austria defeated Halil Pasha and captured Belgrade. After this defeat he was dismissed from the post on 26 August 1717.