The U.S. said Friday that Iran’s foreign minister can visit the country’s ailing U.N. ambassador in a New York hospital -- if his country agrees to release an American prisoner in exchange.

Mohammad Javad Zarif is in New York for the annual U.N. gathering of world leaders, but the Trump administration has strictly sanctioned where within New York City Zarif may travel. Zarif, hoping to visit U.N. Ambassador Majid Takht-Ravanchi as he is being treated for cancer, sought permission from the State Department, U.N. diplomats said.

"Iran has wrongfully detained several U.S. citizens for years, to the pain of their families and friends they cannot freely visit," the State Department said. “We have relayed to the Iranian Mission that the travel request will be granted if Iran releases a U.S. citizen."

Iranian President Hassan Rouhani has said it is America’s turn to release an Iranian citizen.

POLICE RESCUE HUNDREDS OF MEN, BOYS FROM NIGERIAN TORTURE HOUSE THOUGHT TO BE ISLAMIC SCHOOL: REPORT

In July, the U.S. imposed strict travel sanctions on Zarif before a visit to the U.N. -- and on Iranian diplomats living in the U.S. A Treasury Department statement said Zarif had been sanctioned because he "implements the reckless agenda of Iran’s supreme leader and is the regime’s primary spokesperson around the world."

FORMER AMBASSADOR JOSEPH WILSON, DIPLOMAT WHO CHALLENGED CASE FOR WAR IN IRAQ, DIES AT 69

Among those the U.S. seeks to see released: Xiyue Wang, Robert Levinson, Siamak Namazi and Nizar Zakka. All have been accused of spying.

CLICK HERE TO GET THE FOX NEWS APP

On Thursday, President Rouhani said in a news conference that Tehran was open to discussing prisoner swaps but it was Washington’s turn because Iran had released a prisoner named Nizar Zakka in June. But the U.S. deported an Iranian woman who pleaded guilty to exporting restricted U.S. technology to Iran on Tuesday. During a visit to New York in April, Zarif had specifically mentioned her case when talking about prisoner swaps.

Zarif took to Twitter to bemoan the travel restriction. "Thanks to technology, I was able to see and talk to my friend of 40 years and our UN ambassador Ravanchi, who is in hospital here in New York only a few blocks away," said Zarif. U.S. Ambassador to Germany Richard Grenell fired back at Zarif saying his "hypocrisy knows now bounds."

The family of imprisoned Levinson fired back at the minister as well. "It’s nice that you recognize how important it is to be able to see and speak with the ones you love. We are still waiting to see and talk to our father Bob Levinson, held by your country for 12 years with no human rights."

"Where’s Bob Levinson? For 12 years he’s been a US hostage in Iran. The longest held US hostage," Grenell quoted their tweet and added.

The Associated Press contributed to this report.