The Pentagon has notified Turkey that it is canceling its purchase of F-35 fighter jets if the Turkish government goes ahead with the purchase of a Russian missile defense system.

Acting Defense Secretary Patrick Shanahan has sent a letter notifying Turkey that all training of Turkish pilots will also end as of July 31. And all Turkish personnel connected to the F-35 program must leave the country by the end of that month.

Shanahan’s letter to Turkish Defense Minister Hulusi Aka also says Turkey won’t be allowed to take final delivery of the four F-35s it bought.

The letter is the latest in an ongoing dispute over Turkey’s decision to buy the Russian-made S-400 system. The U.S. has repeatedly warned Ankara that the Russian system is considered a threat to the F-35.