In 1861 he was appointed governor of Niš, where he was instrumental in introducing the vilayet system in the Balkans. He was governor of the Danube Province from 1864 to 1868. During his governorship, he built countless schools and educational institutes, built hospitals, granaries, roads and bridges, paying for these projects through voluntary contributions from the people. He clashed with the Grand Vizier Ali Pasha, which led to his appointment as governor of Baghdad in 1869, as the appointment to such a remote posting was intended as a punishment.