ISTANBUL — President Trump’s decision to abandon a nuclear deal with Iran has intensified a heated debate among Iranians over relations with the West, pitting proponents of the landmark accord and of diplomacy more generally against staunch conservatives who urge a harsh response to the move.

The clash between the camps has played out in parliament, on social media and in the press since Trump announced an end to U.S. participation in the agreement Tuesday.

The deal was signed in 2015, under President Barack Obama, and curbed Iran’s nuclear activities in exchange for widespread sanctions relief. Trump said his administration would again impose far-reaching sanctions on Iran, possibly including on oil sales and the country’s banking sector. The International Atomic Energy Agency, the world’s nuclear watchdog, has repeatedly certified Iran’s compliance under the deal.

Reformist newspapers allied with President Hassan Rouhani praised the Iranian leader Wednesday for his diplomatic response to the crisis. He said that Iran was committed to the accord and that he would dispatch his foreign minister to engage in talks with China, Russia and European nations, which are also parties to the agreement. He said Iran could soon begin enriching uranium beyond levels set under the pact.

The pro-reform Etemad newspaper published a headline: “The nuclear deal without the troublemaker.” Other reformist and moderate publications hailed what they said was the “logical choice” to keep Iran in the deal.

Iran’s conservatives, however, seized the opportunity to call for a full withdrawal from a deal they have long opposed. News agencies aligned with Iran’s hard-liners — including the judiciary and the powerful Revolutionary Guard Corps — called for nixing the deal and unifying Iran to resist the United States.

In a dramatic display on the floor of parliament, lawmakers set fire to both the text of the accord and an American flag, chanting “Death to America!” as the assembly speaker looked on.

If Iran does not immediately restart enriching uranium, “it is treason against our nation,” said Seyed Nasser Mousavi Largani, a hard-line parliamentarian and former Revolutionary Guard member, the Fars News Agency reported.

The Revolutionary Guard commander, Maj. Gen. Mohammad Ali Jafari, said he believes that Europe, which is sticking by the agreement, is too weak to uphold it without the United States. The “fate of the deal is clear,” he said.

The parliament introduced a bill Wednesday that would cap Rouhani’s negotiations with Europe, Russia and China at one month. If Tehran’s demands are not met, Iran would ramp up its nuclear program, the bill said. It was not clear what guarantees Iran was seeking from the other signatories.

The infighting among Iran’s political factions paints “a picture of the domestic challenges that lie ahead” now that the agreement is in jeopardy, said Reza H. Akbari, who researches Iranian politics at the Institute for War and Peace in Washington.

Opponents of the 2015 agreement “are enjoying their ‘I told you so’ moment,” he said. “From the get-go, they argued that the United States could never be trusted. They believe now is the best moment for Iran to save whatever dignity it has left and completely withdraw from the deal.”

Iran has long insisted that its atomic energy program is for peaceful purposes. The United Nations and world powers imposed stringent sanctions on Iran to persuade the government to negotiate the parameters of its nuclear activities.

Rouhani — first elected in 2013 and reelected for a second term last year — championed diplomacy with the West and secured what was then a major victory: the end of sanctions and Iran’s return to the international stage.

Since then, however, the windfall he promised from the nuclear deal has failed to materialize. Instead, Iran has faced stagnant growth, high unemployment and a collapsing currency. In December and January, widespread street protests broke out as prices skyrocketed.

For now, analysts say, Iran’s supreme leader, Ayatollah Ali Khamenei, is giving Rouhani flexibility to try to save the deal. The supreme leader has the final say over all major decisions involving foreign and defense ­policies, including Iran’s contacts with the West and the country’s missile and nuclear programs.

Khamenei said Wednesday that Iran would not “stick to the nuclear agreement” without a “strong guarantee” from Europe. He said Iran does “not trust” the European signatories to the deal. “We agreed on the nuclear pact,” he said. “But the animosities against Iran did not cease.”

Nader Hashemi, director of the Center for Middle East Studies at the University of Denver, said, “It seems Rouhani has been given some room by Khamenei to keep the nuclear deal alive.”

Iran has few options beyond complying with the agreement — or ratcheting up its nuclear activities and potentially rupturing ties with Europe.

“Iran will likely ramp up elements of its nuclear program in the coming months but do so in a carefully calibrated way. It will try to avoid alienating Europe,” the New York-based political risk firm, Eurasia Group, said in a briefing note Wednesday. Iran will “likely increase” certain aspects of the program, but will “stay away” from drastic measures that could prompt an Israeli or U.S. military strike, the note said.

As tensions rise, however, hard-line voices are gaining traction.

“Iranian hard-liners are the masters of the art of saber-rattling, and Trump’s decision to withdraw from the agreement just provided them with the best platform to showcase their skills,” Akbari said. “Recent developments could easily shift the balance of power.”

Brian Murphy in Washington contributed to this report.