ISTANBUL — An American citizen accused by Turkey of belonging to the Islamic State militant group will be repatriated after Ankara received confirmation that he will be accepted by the United States, Turkey’s state-run news agency said Thursday.

Turkey’s Interior Ministry has not identified the man, referring to him only as a “foreign terrorist,” without citing any specific accusations. Turkish media outlets have identified him as a 39-year-old American of Jordanian heritage.

The man has been stuck at the border between Greece and Turkey since Monday, after the government of Turkish President Recep Tayyip Erdogan attempted to deport him to Greece. Erdogan has vowed to start repatriating hundreds of foreign militants held in Turkish custody, in a process that began this week with the deportation of the man along with several European nationals.

“We are aware of reports regarding a U.S. citizen located between the border of Greece and Turkey and are monitoring these reports closely,” the State Department said Thursday in an emailed statement. “Due to privacy considerations, we have no further comment. In general, consular personnel seek to provide all appropriate consular assistance to ensure the individual’s safety and welfare.”

Suleyman Soylu, Turkey’s interior minister, said in an interview published Wednesday that the man had expressed his preference to be deported to either Greece or the Netherlands and finally chose Greece.

“We prepared his documents and deported him. Greece also has the right not to take him, and they didn’t,” Soylu told the daily Sozcu newspaper. “We also have the right not to take him back,” he added.

Police in Greece gave a different version of events, saying in a statement Monday that Turkish police had requested that the man, who they said had “exceeded his legal stay in Turkey,” be allowed to enter Greece. But the man “stated that he did not want to enter Greece,” the statement said, and returned to Turkey.

A search of databases maintained by “Greek authorities and those of other cooperating countries did not reveal anything against” the man, the statement added, apparently referring to criminal charges.

Even so, when the man returned to the Greek border post later in the day, he was denied entry into Greece, the police statement said.

Turkish media outlets recorded footage of the man, who was wearing a black, long-sleeve shirt and waving to reporters from behind a metal border gate Monday. He was permitted by Turkish border security to sleep in a car at night and during the day was sent back to the buffer zone, Anadolu, the state news agency reported, adding that the man was provided food.

The apparent change in his circumstances Thursday came a day after Erdogan visited President Trump in Washington for talks that Trump described as “wonderful and productive.”

Labropoulou reported from Athens.