(CNN) Iran's foreign minister, Mohammad Javad Zarif, who played a key role in the 2015 nuclear deal, announced his resignation Monday.

"I sincerely apologize for the incapacity to continue serving and all the shortcomings during the service," Zarif wrote on his Instagram account, adding, "Be happy and upbeat."

On Tuesday morning, he urged foreign ministry employees and Iranian diplomats not to follow suit. "I humbly urge all my colleagues in the Foreign Ministry and Iran's foreign missions to be fully committed to defending the country and avoid taking such measures," Zarif said in a message to the ministry's personnel, Iran state media IRNA reported.

Iranian President Hassan Rouhani has not yet accepted Zarif's resignation, the top diplomat added.

Iranian Foreign Minister Mohammad Javad Zarif in Beijing, China, on February 19.

Deputy foreign ministry spokesman Sayyed Abbas Moussawi confirmed Zarif's resignation in an interview with IRNA.

Read More