President Donald Trump thanked Syrian Kurds on Sunday for their role in the U.S. operation that killed the Islamic State militant group's leader Abu Bakr al-Baghdadi.

Addressing the nation live from the White House, Trump said the Kurds did not play a military role in the "dangerous and daring" raid, but provided "some information that turned out to be helpful."

The public recognition represented a stark turn from Trump's decision to withdraw from northern Syria, leading to widespread criticism he had essentially abandoned the longtime U.S. allies and cleared the way for Turkey's invasion.

The commander in chief of the Kurdish-led Syrian Democratic Forces, Gen. Mazloum Abdi, hailed the raid early Sunday, adding that there was "joint intel cooperation on the ground and accurate monitoring" for five months.

"Thanks to everybody who participate in this great mission," he said on Twitter, tagging Trump in the post.

SDF spokesperson Mustafa Bali also touted a "successful and effective operation by our forces” early Sunday, without referring to al-Baghdadi by name.

It was "yet another proof of SDF's anti-terror capability," Bali added.

Trump said al-Baghdadi killed himself and three of his children, detonating a suicide vest as U.S. forces closed in on a compound in northwestern Syria.

Trump also acknowledged others he said played a part in the operation, including Russia, Turkey, Syria and Iraq.

Turkey's defense ministry claimed on Twitter on Sunday that prior to the U.S. raid, there was "information exchange and coordination between the military authorities of both countries."

Trump confirmed Sunday that Ankara "knew we were going in."

Al-Baghdadi's death comes amid mounting fears of a possible ISIS resurgence in the wake of Trump's decision to move U.S. troops out of northeastern Syria to clear the way for the Turkish invasion earlier this month.

The move drew widespread criticism at home and abroad.

After initially announcing U.S. forces would withdraw amid the growing chaos in the region, the United States has since begun reinforcing some positions to prevent oil fields from falling into the hands of ISIS, a U.S. defense official said.

That operation is being done in coordination with the SDF.

Trump said Sunday the pullout of U.S. troops "had nothing to do" with the operation to take down al-Baghdadi.

Joshua Geltzer, a former top counterterrorism official on the National Security Council under Trump and former President Barack Obama, told NBC News that al-Baghdadi's death would not undo the damage of the U.S. withdrawal.

“This is potentially a significant step in degrading ISIS' capacity to continue claiming preeminence in the jihadist movement, but it still doesn’t come close to overcoming the step backward the U.S. took in abandoning its ground partners against ISIS in Syria," he said.

Kurdish forces declared territorial victory over ISIS in March after years of fighting, supported by the U.S.

They continued to hold thousands of ISIS supporters prisoner in the northeast of the country, where they established a home in the early days of Syria's chaotic civil war.

But Turkey has been determined to establish a “safe zone” for Syrian refugees, free of Syrian Kurdish fighters along its border with Syria.

The cease-fire deal agreed to between the U.S. and Turkey, which Trump said last week would be "permanent," would seemingly allow them to achieve that goal.

The Syrian Democratic Forces are led by the Kurdish People's Protection Units (YPG), which has long angered the Turkish government. Turkey views the YPG an extension of the separatist Kurdistan Workers’ Party, which is considered a terrorist group by the U.S.