In his phone call with President Donald Trump, Turkish President Recep Tayyip Erdogan reportedly promised that Turkey would take responsibility for finishing off the Islamic State if the U.S. pulled out of Syria, a senior White House official tells NBC News.

“Erdogan said to the president, ‘In fact, as your friend, I give you my word in this,’” the official said, speaking on condition of anonymity to disclose details of a presidential phone call.

A second U.S. official confirmed that Erdogan had said during the call that Turkey could deal with any remaining ISIS fighters if Turkey were able to operate in northern Syria.

The Turkish Embassy in Washington and Turkish officials in Ankara had no comment Saturday.

What took place during Trump’s phone call Friday with the Turkish leader has been a central question in the debate over Trump’s decision to pull all U.S. troops out of Syria, a decision he made without consulting U.S. allies and over the opposition of all his top national security aides. Defense Secretary Jim Mattis resigned in part in protest over the Syria decision, and on Saturday, NBC News reported that the U.S. envoy leading the coalition to defeat ISIS, Brett McGurk, has also resigned in protest.

Turkey has long sought a withdrawal of U.S. troops from Syria to clear the way for Turkish forces to attack Kurdish forces in northern Syria. Turkey considers the Kurdish forces to be terrorists who threaten Turkey's stability, but the U.S. has been training the Kurdish troops and relying heavily on them to fight ISIS there.

Although a senior Trump administration official who briefed reporters last week said that Trump merely informed Erdogan of his plans to withdraw, other U.S. officials as well as Turkish officials have told NBC News that Trump agreed to pull out of Syria during the call after Erdogan argued that with ISIS nearly defeated, there was no need for U.S. troops to stay.

For Trump, the Turkish offer underpins his argument that the U.S. can safely withdraw from Syria without risking a resurgence of ISIS because other countries can and will ensure the extremist group’s lasting defeat. Although ISIS has been wrested from nearly all of the territory it once held in Syria, terrorism experts have warned that the group still has fighters there who could exploit a vacuum of power to reconstitute themselves and potentially plan attacks on the U.S.

Trump tweeted Saturday that the U.S. had stayed in Syria far longer than originally envisioned and claimed that when he took office “ISIS was going wild.”

“Now ISIS is largely defeated and other local countries, including Turkey, should be able to easily take care of whatever remains,” Trump wrote. “We’re coming home!”