BEIRUT, Lebanon — The surprise resignation of Iran’s foreign minister last week was a rare public display of the jockeying between hard-liners and the more moderate camp within the clerical leadership, a divide that has been exacerbated by the country’s deepening economic crisis, analysts said.

Hard-liners have long had the edge. But Foreign Minister Mohammad Javad Zarif’s open show of frustration was a sign that he and his ally, President Hassan Rouhani, find themselves further weakened after the collapse of their biggest foreign policy project — the 2015 nuclear deal with the United States and other world powers.

The further empowerment of the hard-liners could presage even more tense relations with the United States and worsen Iran’s economic crisis, fueling instability.

“Since the U.S. withdrawal from the nuclear deal, Zarif is suffering,” said Talal Atrissi, a sociology professor at the Lebanese University in Beirut who studies Iran and its regional allies. The foreign minister, he said, “strongly believed in dialogue and negotiations with U.S., but the cancellation of the deal showed that the strategy that Zarif was following wasn’t correct.”