WASHINGTON >> President Donald Trump said he had sent a letter to the Iranian government seeking to negotiate a deal to prevent Iran from acquiring a nuclear weapon.

He said the letter was sent Wednesday and addressed to Ayatollah Ali Khamenei, Iran’s supreme leader. The White House did not immediately respond to a request to provide the letter or further describe its contents. Iran’s mission to the United Nations said Friday that Iran had received no such letter to date.

In an interview that aired Friday on Fox Business, Trump said: “There are two ways Iran can be handled: militarily, or you make a deal. I would prefer to make a deal, because I’m not looking to hurt Iran. They’re great people.”

The move is a sharp pivot for Trump, who in 2018 withdrew the United States from a nuclear deal with Iran, unraveling a signature foreign policy achievement of his predecessor, Barack Obama.

In the interview, with Fox Business host Maria Bartiromo, Trump described his letter as saying, “I hope you’re going to negotiate because it’s going to be a lot better for Iran.”

“If we have to go in militarily, it’s going to be a terrible thing for them,” he said. “The other alternative is we have to do something, because you can’t let them have a nuclear weapon.”

On Thursday, Trump talked more broadly about his desire to see the world’s countries eliminate their nuclear weapons. He said he hoped to negotiate denuclearization efforts with China and Russia as well.

“It would great if everybody would get rid of their nuclear weapons,” he told reporters in the Oval Office.

In Iran, officials have vigorously debated whether to negotiate with Trump. Moderate and reformist factions, which hold the presidency, are in favor of talks, while hard-line conservatives oppose them. Iran’s economy is in shambles because of international sanctions and mismanagement, and President Masoud Pezeshkian was elected last year largely because of his pledges to improve the economy by negotiating directly with Washington.

But in Iran’s political system, Khamenei has the last word in all key state matters. He rejected negotiations with the United States after Trump signed an executive order last month to enforce a maximum pressure policy on Iran, and he has repeatedly said Iran cannot trust that the United States would honor its end of any bargain.

Pezeshkian publicly distanced himself from Khamenei’s positions on the United States. On Sunday, Pezeshkian told the parliament that he favored negotiations but that he had to abide by Khamenei’s ban on them. It was an unusually frank acknowledgment of the limits of the president’s power in Iran’s political system and an attempt to put the fallout of such a decision — more sanctions, worsening economy, military strikes on nuclear sites — on Khamenei.

“My position has been and will remain that I believe in negotiations, but now we have to follow the parameters set by the supreme leader,” Pezeshkian said.