Appointed as Amir of Medina by Hazrat Umar (ra)
Hazrat Musleh-e-Maud (ra) states:
“It is proven from historical sources that during his era of Khilafat, Hazrat Umar (ra) appointed Hazrat Ali (ra) as the amir of Medina in his absence on certain occasions when he would have to travel somewhere. For example, in Tarikh al-Tabari it states that during the incident of Jisr, whereby the Muslim army suffered a huge setback from the Persian forces, Hazrat Umar (ra) decided upon consulting with various people that he would go with the Muslim army to the frontier region of Iran. On this occasion, Hazrat Umar (ra) appointed Hazrat Ali (ra) as the governor of Medina.”
(Haqq al-Yaqin, Anwar al-‘Ulum, Vol. 9, pp. 282-284)