Iran’s parliament on Sunday approved an outline of a bill that would allow the government to implement the nuclear deal reached with world powers including the US in July, the official IRNA news agency said.

Iran also tested a new precision-guided ballistic missile on Sunday, in defiance of a United Nations ban and signalling an apparent advance in attempts to improve the accuracy of its missile arsenal.

State television showed what appeared to be a successful launch of the new missile, named Emad, Iran’s first precision-guided weapon with the range to strike Israel.

The measure approved in parliament allows the Iranian government to withdraw from implementing the nuclear agreement if world powers do not lift sanctions, IRNA said. Final approval is expected later this week.

The deal would curb Iran’s nuclear programme in return for the lifting of international sanctions. Western nations have long suspected Iran of secretly pursuing nuclear arms, allegations denied by Tehran, which says its nuclear program is for purely peaceful purposes.

“The government should stop its voluntary co-operation in implementation of the deal if the other side fails to remain committed to lifting sanctions,” the Iranian bill says. It says the response should be the same if new sanctions are imposed or previous ones restored.

IRNA said 139 lawmakers out of 253 present on Sunday voted for the bill. The chamber has 290 seats.

The session was unusually tense, with hardliners repeatedly trying to prevent a vote. Iran’s supreme leader, Ayatollah Ali Khamenei, has said it is up to parliament to approve or reject the deal.

Lawmaker Ruhollah Hosseinian, an opponent of the deal, said parliament needed to discuss it in detail. Until now, it has only been reviewed by a parliamentary committee.

“Every [international] agreement must be approved and passed by the parliament. Otherwise, it won’t be legal,” Hosseinian said.

Hardliners hope to stall approval of the deal in order to weaken President Hassan Rouhani’s moderate administration, ahead of February’s parliamentary elections.

The UN security council prohibits foreign powers from assisting Iran in developing its ballistic missile programme in any way, a ban that will remain in place under the terms of the nuclear deal while other sanctions are lifted.

On Sunday, in a televised news conference, defence minister Hossein Dehghan said: “The Emad missile is able to strike targets with a high level of precision and completely destroy them … this greatly increases Iran’s strategic deterrence capability.”

The UN also prohibits Iran from undertaking any activity related to ballistic missiles that could deliver a nuclear warhead, which applies to the Emad. Iranian officials have pledged to ignore the ban.

“We don’t ask permission from anyone to strengthen our defence and missile capabilities,” Dehghan said. “Our leadership and armed forces are determined to increase our power and this is to promote peace and stability in the region. There is no intention of aggression or threats in this action.”

Iran is wary of a potential pre-emptive strike on its nuclear sites by Israel. In turn, Israel fears that the nuclear agreement may be insufficient to stop Tehran developing an atomic bomb.