Iranian President Masoud Pezeshkian lashed out at the U.S and Israel for their attacks in June during a speech at the United Nations on Wednesday, one day after Supreme Leader Ayatollah Ali Khamenei, the highest authority in the country, ruled out talks with President Donald Trump about Iran’s nuclear program.

“The aerial assaults of [Israel] and the United States of America against Iran’s cities, homes and infrastructure, precisely at a time when we were treading the path of diplomatic negotiations, constituted a grave betrayal of diplomacy and a subversion of efforts towards the establishment of stability and peace,” he said.

At the podium, Pezeshkian held up a book with the words “Killed By Israel” printed on the front and leafed through pages with pictures of families and children.

There have been calls among moderates in Iran for direct talks with Trump, but on Tuesday Khamenei rejected negotiations with the U.S. about the country’s nuclear program and in many ways set the parameters of what Pezeshkian could discuss in New York.

“In my view, negotiating with America about the nuclear issue and maybe other issues is an absolute dead end,” Khamenei said in an address, adding that Iran would not stop uranium enrichment because it would not be acceptable to the people of the country, according to his official website.

He added, “This negotiation will be beneficial for the current American president. He will hold his head high, say I threatened Iran and I brought them to the negotiating table. He will be proud of this in the world. But for us it’s an absolute loss and has no benefit.”

Khamenei also said on Tuesday that Iran does not intend to build a nuclear weapon, a point that Pezeshkian highlighted in his speech Wednesday, and that it will not negotiate on its ballistic missile program.

NBC News has reached out to the White House for comment.

Khamenei’s remarks came as the Trump administration appeared to be showing a willingness to hold talks. Trump’s Middle East envoy, Steve Witkoff, said Wednesday that Iran is in a tough position and that the administration wants to negotiate with it, according to Reuters.

“We’re talking to them,” Witkoff said when asked if there is a diplomatic path forward with Iran.

But the hard line drawn by Khamenei against talks with Trump about the nuclear issue could significantly ramp up tensions with the U.S. and Israel.

The value of the Iranian rial against the U.S. dollar hit a record low Wednesday after Khamenei’s remarks.

Moderate voices in Iran pushing for direct talks with the U.S. were hoping to stave off more devastating attacks on the country by either the Israeli or U.S. military, which pummeled the Fordo, Natanz and Isfahan nuclear sites in late June with airstrikes, including the first combat use of massive “bunker buster” bombs.

Trump, addressing the United Nations on Tuesday, said the attacks had targeted “Iran’s key nuclear facility, totally obliterating everything.” But analysts have raised questions about the extent of the damage caused by the attacks and the whereabouts of the approximately 880 pounds of enriched uranium that Iran is thought to have produced.

The Israeli attacks, which Israeli officials said were intended to stop the Islamic Republic from obtaining a nuclear weapon, also hammered nuclear targets but expanded to include energy infrastructure and even the country’s notorious Evin prison, and killed more than 1,000 people, according to state media.

Even if Iran does not talk to the U.S. directly, Pezeshkian and his foreign minister, Abbas Araghchi, only have until Sep. 27 to negotiate a diplomatic solution with Britain, France and Germany before they face a “snapback” of sanctions. Negotiated under the 2015 nuclear deal, the snapback would lead to an arms embargo, freezing of assets outside the country and restrictions on enriching uranium, among other penalties.

The sanctions could hit at a time when the country is reeling from an economic crisis, which critics blame on current sanctions as well as corruption and mismanagement.

French President Emmanuel Macron met with Pezeshkian on the sidelines of the U.N. meeting in New York on Wednesday and posted on X that a diplomatic solution to avoid snapback could still be reached if Iran allows full access to inspectors from the International Atomic Energy Agency, is transparent about its stockpile of enriched materials and resumes negotiations.

“An agreement remains possible. Only a few hours are left,” Macron wrote. “It is up to Iran to respond to the legitimate conditions we have set.”

In recent months, Pezeshkian has been fighting for his political, and actual, life. He narrowly escaped an Israeli attack on a meeting of top officials in June, and his conservative critics have pressed him hard on the economy as well as restrictions on social freedoms.

Security forces kicked off a massive crackdown during and after the war. The crackdown was ostensibly to ferret out spies, but in many cases the security forces used the war as a pretext to detain ethnic and religious minorities as well as Afghan migrants, according to Amnesty International. A police spokesman said in mid-August that 21,000 people had been arrested in the 12-day period of the war and observers say that more arrests have subsequently taken place and pending executions have been expedited.

“They’re targeting already marginalized groups even further, and that’s one way for them to exert and show the control that they have and try to retain their power while also instilling fear in the population,” said Nassim Papayianni, an Iran campaigner at Amnesty International. “You’re talking about scapegoating. So essentially they are trying to use the conflict as a way to ramp up the crackdown and the arrests.”

With Pezeshkian’s hands tied on the international stage by the supreme leader and his hard-line opponents pressing a crackdown on real and perceived enemies at home, the Iranian president appears more isolated than at any point since assuming his position last year.