 After returning from the post of consulate general of Tbilisi, Mohammad Gasem went to Saint Petersburg with grand ambassador Abbas Goli Khan Nuri as an embassy advisor to congratulate the coronation of Alexander III, Tsar of Russia and after returning, he was appointed first as minister resident and then minister plenipotentiary in Saint Petersburg.During youth, Ali Khan was living in Russia with his father and started studying French language, history, geography and geometry there and learned the new art of photography along with it.After returning, Mohammad Gasem was appointed as the governor of Gilan and performed valuable services there, including checking law enforcement of the cities, building the Iraq road and checking the stations along the roads.