Mohammad Javad Zarif, 59, announced the decision unexpectedly to his 682k followers on Monday.
He wrote: “Many thanks for the generosity of the dear and brave people of Iran and its authorities over the past 67 months.
“I sincerely apologise for the inability to continue serving and for all the shortcomings during my service.
“Be happy and worthy,” he added.
The decision remains a mystery, as he gave no specific reasons for resigning.
“I sincerely apologise for the inability to continue serving and for all the shortcomings during my service”
Mohammad Javad Zarif, former Iranian Foreign Minister
It comes as his nuclear deal which he worked on in 2015 faces major threats.
The landmark deal saw Iran agree to curbs on its nuclear programme in return for the lifting of international financial sanctions.
He was attacked by anti-Western hardliners in the Islamic Republic after Donald Trump pulled out of the agreement last May, imposing new sanctions on the country’s economy and precious oil industry.
A spokesman for the Iranian mission to the UN, Alireza Miryousefi, confirmed the announcement of the resignation.
But it isn’t known if the country’s president Hassan Rouhani will accept it.
Zarif’s decision puts further pressure on Rouhani — who has been seen as a pragmatist — as voices in Iran call for a more aggressive strategy.
Educated in the US from the age of 17, Zarif also served as a diplomat to the UN.
He was appointed Minister of Foreign Affairs in August 2014 after Rouhani won the presidential elections in a landslide, promising to open up the country to the outside world.
Although Rouhani chose Zarif, the country’s Supreme Leader Ayatollah Ali Khamenei traditionally has the last say over appointing key ministers.
In February 2014, Zarif caused uproar when he condemned the Holocaust, which many in the country’s extremist government deny.
He was even threatened with physical harm when he organised the nuclear deal.
Earlier this month, a former commander of the country’s hardline Revolutionary Guards Corps, Hassan Abbasi, said he believed Iran’s people would spit on Zarif and those who supported the nuclear deal.
“Rouhani, Zarif, go to hell,” he said.