Zarif's post shows the message against the background image of Fatima, the daughter of Prophet Muhammad, with Iran marking the day on her birth on Monday.
Zarif played an important role in striking the 2015 nuclear deal between Iran and six world powers.
U.S. President Donald Trump past year announced Washington was pulling out of the deal, and later moved to reimpose sanctions on Tehran.
It is not clear at this time if Iranian President Hassan Rouhani will accept Zarif's resignation.
Mr Zarif's resignation was confirmed by Iran's state-run news agency, IRNA, which cited a spokesman for the foreign ministry.
Zarif has served as Iran's foreign minister since 2013.
Zarif's standing within Iran's political establishment took a hit when the United States withdrew from the nuclear deal in May 2018 and the deal's achievements became less and less clear as Iran's economy suffered.
Reaction to Zarif's resignation was swift.
"He has handed in his resignation, but that doesn't mean that this is the end of this story", said Trita Parsi, president of the National Iranian American Council in Washington.
The resignations happened hours after a surprise visit by Syrian President Bashar Al-Assad to Tehran.
But the future of the deal has been put into doubt after US President Donald Trump ended US involvement. Khamenei guardedly backed the deal, under which Iran agreed to curb its nuclear work.
Ahmadinejad wanted him replaced, but Supreme Leader Ayatollah Ali Khamenei intervened to keep him in the position for another two years as Iran soon found itself an global pariah over its nuclear program.
Secret backchannel talks between the United States and Iran in Oman became full-fledged negotiations over its nuclear program.