In 1720 he was appointed as governor of Bosnia, before being shifted to Rumeli in the next year. He remained at this post until 1727, when he returned to Bosnia for two years. In 1729 he was re-appointed to Rumeli, before being shifted back to Bosnia in 1730, and again to Rumeli in 1731. During this period, he eliminated the surviving supporters of the rebel Patrona Halil, who had taken refuge in the western Balkans, particularly Albania. On 10 September 1731, he was named Grand Vizier by Sultan Mahmud I. Although he served only for six months as Grand Vizier, he tried to enact reforms to stabilize the volatile situation in the capital, Istanbul, by stabilizing prices, restoring order and ensuring the city's supply with food. He also encouraged the efforts of the French army officer Claude Alexandre de Bonneval in reforming the "humbaracı" artillery corps after Western models.