U.S. Defense Secretary Jim Mattis says Turkey gave the U.S. military advance notice of its airstrikes against Kurdish targets in northern Syria.

Mattis defended Turkey, calling it a trusted NATO ally with "legitimate security concerns" about Syria.

Speaking to reporters traveling with him overnight Sunday to Jakarta, Indonesia, Mattis said diplomats are working on a solution to Turkey's armed confrontation with Syrian Kurds, who have been the key U.S. military ally in battling the Islamic State in Syria.

He said the U.S. forces based in Syria had not been put at risk by the Turkish attacks, since U.S. troops are not based in that part of Syria.