Turkey’s president has warned that he would evict U.S. forces from two military bases in his country if Washington imposes new sanctions on his government—creating a quandary for the NATO alliance as it seeks to cope with Ankara’s deepening ties to Russia.

In a television interview this month, President Recep Tayyip Erdogan said if the U.S. punishes Turkey for its purchase of a Russian air-defense system, then, “if necessary, we may close Incirlik and Kureci,” installations where the U.S. keeps nuclear weapons and operates critical radar.

The declaration elicited an anxious reaction from U.S. Defense Secretary Mark Esper, who said it raised questions about Turkey’s dedication to the North Atlantic Treaty Organization.