(Adds background)

NEW YORK, Sept 22 (Reuters) - Iran has become self-sufficient in wheat and aims to export wheat in the coming months, Iranian President Hassan Rouhani said on Thursday.

"We had a good year that led Iran to stop importing wheat. We are planning to export wheat in the coming months," Rouhani told a news conference on the sidelines of the annual U.N. gathering of world leaders.

Iran has been a major wheat importer in recent years as the country aimed to guarantee local food supplies, although its needs have varied partly due to erratic domestic production.

Iran's Agriculture Ministry said in June that 4.2 million tonnes of wheat had been bought from domestic farmers this year in state-sponsored purchases, some 20 percent increase from the same period last year.

(Writing by Parisa Hafezi; Editing by James Dalgleish and Sandra Maler) ((parisa.hafezi@thomsonreuters.com; +90-532-176-3452; Reuters Messaging: parisa.hafezi@thomsonreuters.com))