TEHRAN (AFP) - Intelligence Minister Heydar Moslehi, who resigned from his post, was reinstated by supreme leader Ayatollah Ali Khamenei despite the resignation being accepted by the president, reports said Sunday. Heydar Moslehi will continue his work in the ministry as minister after his resignation was rejected by the supreme leader, news agencies ISNA, Fars and Mehr reported. Earlier on Sunday, state news agency IRNA reported that Moslehi had quit and that his resignation had been accepted by President Mahmoud Ahmadinejad. IRNA also reported that Ahmadinejad immediately appointed Moslehi as his adviser on intelligence affairs. I thank and appreciate your efforts during your tenure in the post of intelligence minister... I accept your resignation, Ahmadinejad was quoted as saying in a letter to Moslehi carried by IRNA. IRNA did not specify the reasons for the resignation of Moslehi who was a newcomer in Ahmadinejads second term cabinet. Ahmadinejad was returned to office after a disputed presidential election in June 2009. Moslehi had replaced Gholam Hossein Mohseni Ejeie, now Irans prosecutor general, who was sacked by Ahmadinejad from the post in July 2009. In December, Ahmadinejad sacked his then foreign minister Manouchehr Mottaki who had served for more than five years in the post.