The U.N. Security Council unanimously adopted a resolution on Monday endorsing the deal, which relieves Iran of sanctions and ensures it retains a nuclear fuel cycle, but keeps in place an arms embargo and a ban on ballistic missile technology for several more years.

The agreement, a major initiative for both U.S. President Barack Obama and Iran’s pragmatic President Hassan Rouhani, faces opposition from hardliners in both countries. In addition to the United States, it was signed by the four other U.N. Security Council veto-wielding permanent members, as well as Germany.

In the United States, Obama has said he would veto an attempt to scupper the deal by the Republican-led U.S. Congress.

In Iran, Khamenei, who wields final authority above that of the elected leader Rouhani, has so far withheld a clear verdict.

By asserting that the deal goes beyond limits which Khamenei himself set, hardliners may be trying to push him to reject it. The deal is still under review and must be endorsed by Iran’s National Security Council and later by Khamenei.

“Some parts of the (resolution) draft have clearly crossed the Islamic republic’s red lines, especially in Iran’s military capabilities,” top Revolutionary Guards commander Mohammed Ali Jafari was quoted as saying shortly before the resolution was passed in New York.

“We will never accept it,” he was quoted as saying by the semi-official Tasnim News Agency.

Hossein Shariatmadari, editor-in-chief of Kayhan, a newspaper closely associated with Khamenei, wrote that accepting the new resolution would be tantamount to accepting previous Security Council resolutions, which Iran considers illegal.

“Even by simply looking at the deal you can see some vital red lines of the Islamic Republic have not been preserved,” he wrote.

Ahmad Bakhshayesh, a member of the National Security and Foreign Policy Committee in parliament, said the nuclear negotiations had veered too far into the military sphere.

“The negotiating team was not supposed to negotiate on Iran’s ballistic missile technology,” he was quoted as saying by Fars News Agency.

“UNPRECEDENTED ACHIEVEMENT”

Rouhani has defended the deal staunchly in Iran. His senior nuclear negotiator, Seyed Abbas Araghchi, dismissed critics’ concerns and said the U.N. Security Council resolution was an “unprecedented achievement in Iran’s history”.

“....The new UNSC resolution would only ban missiles designed to carry a nuclear warhead, (and) Iran does not have a nuclear missile program,” Araghchi told state broadcaster IRIB in a live interview.

Iran’s Foreign Ministry said in a statement issued minutes after the U.N. Security Council passed its resolution that it still rejects any sanctions as “baseless, unjust and illegal”.

“So no part of (the nuclear deal) should be interpreted directly or indirectly as Iran’s surrender to or acceptance of the sanctions and restrictions imposed by the UNSC, the U.S., the E.U. or member countries.”

While avoiding a clearcut verdict in public, Khamenei said in a sermon at prayers on Saturday that he would not let the deal be “abused” or endanger “Iran’s security and defense capabilities”.

He asked the nation to stay united while the agreement is being examined by officials to ensure national interests were preserved.

Iranian supporters of the deal say Khamenei was briefed on the negotiations and it could not have gone through without his green light. But opponents say the Supreme Leader’s decision to subject the text to scrutiny means he has not yet agreed to it.

“It’s impossible that our Supreme Leader agrees with a deal that has crossed the red lines. The leader would have not asked the text of the deal to be examined carefully if he had already endorsed it,” Shariatmadari said.

The head of Iran’s nuclear organization Ali Akbar Salehi and Iranian Foreign Minister Mohammad Javad Zarif, the two main negotiators in Vienna, will attend a closed-door session of parliament on Tuesday to brief lawmakers on the deal.