Following the war, Jalili began working as a university lecturer at his alma mater. In 1989 Jalili began working at the ministry of foreign affairs in addition to his teaching post. From 1995 to 1996 he served as director of the inspection office at the ministry. In 2001, he was appointed senior director of policy planning in the office of the supreme leader, Ayatollah Ali Khamenei. Jalili was also made a member of the Supreme National Security Council in 2002. Following the election of Mahmoud Ahmadinejad to the presidency in August 2005, Jalili was appointed deputy foreign minister for European and American affairs. He was in office until October 2007. During the same period, he also served as an advisor to Ahmedinejad. On 20 October 2007, Jalili replaced Ali Larijani as secretary of the council and became responsible for international negotiations over Homeland’s nuclear program. Jalili’s term as secretary of the council ended on 10 September 2013 when Ali Shamkhani was appointed to the post. Immediately after leaving the office, he was appointed by the Supreme Leader Ali Khamenei to the Expediency Council as a member.