 When military chief Nader Shah expelled the Afghans, Mirza Mehdi Khan supported him in the Safavid court.During his long service to Nader, he first functioned as "head of the royal correspondance" ("Monshi-ol-Mamalek"), until Nader's coronation at the Mugan plain in 1736.Afterwards, he became his official biographer and historiographer.