Four years later, he became chief of the Iranian Police Forces after the previous commander was dismissed following the 1999 student protests. He was also appointed as Representative of President Mohammad Khatami during a campaign to combat smuggling in 2002. In September 2005, he was elected as Tehran's mayor by the City Council of Tehran. He is also a professor at the University of Tehran.