Turkey had earlier planned to buy missiles from China, but that deal fell through under pressure from the United States.

Western arms makers lobbied hard for the expansion of NATO into former Soviet satellite countries after the collapse of Communism. They have since lobbied both new and old NATO member states not to stray outside the alliance for weapons purchases that would cut into their business.

Mr. Erdogan dismissed issues of interoperability, brand loyalties or the geopolitical optics of such a sale. “Nobody has the right to discuss the Turkish republic’s independence principles or independent decisions about its defense industry,” the daily newspaper Hurriyet reported him as saying.

“We make the decisions about our own independence ourselves,” he said. “We are obliged to take safety and security measures in order to defend our country.”

Mr. Erdogan’s announcement — made to Turkish journalists aboard his presidential jet as he returned from Kazakhstan — appeared timed as a riposte to two judicial cases announced last week in the United States. One is against his presidential bodyguards, who are charged with assaulting protesters when Mr. Erdogan visited Washington this year. The other is against a group of Turks, including a former minister, accused of breaking United States sanctions against Iran.

Mr. Erdogan has angrily criticized both cases.

Yet Turkey has other reasons for the missile purchase. It needs to cultivate good relations with Russia, and it also needs to build its own military defense, said Asli Aydintasbas, a fellow at the European Council on Foreign Relations. “Turkey wants the deal,” she said, “and Russia is only too happy to drive a wedge into the NATO alliance.”

NATO’s collective defense should be sufficient for Turkey; indeed, NATO deployed Patriot missiles there during a rise of tensions with Syria in the past. But Mr. Erdogan has lost trust in the West since last year’s failed coup, which he has interpreted as a Western plot to oust him, and appears determined to secure his own defense, Ms. Aydintasbas said.