Turkey's President Recep Tayyip Erdoğan warned Thursday he would flood Europe with millions of Syrian refugees if European countries condemn the invasion of northern Syria.

"We will open the gates and send 3.6 million refugees your way," Erdoğan said in a speech to members of his Justice and Development political party.

The threat comes straight out of the Russian playbook. Russia and its ally, Syrian President Bashar Assad, spurred waves of refugees into Europe in 2015 after attacking civilian populations in Syria. The operations were meant to destabilize Europe, said the former NATO supreme allied commander, Gen. Philip Breedlove.

"Together, Russia and the Assad regime are deliberately weaponizing migration in an attempt to overwhelm European structures and break European resolve," Breedlove told the Senate Armed Services Committee in 2016.

Assad's use of barrel bombs and Russia's use of unguided munitions prove that the regimes intended to cause mass migration into Europe, Breedlove said.

"These indiscriminate weapons used by both Bashar al-Assad, and the non-precision use of weapons by the Russian forces — I can't find any other reason for them other than to cause refugees to be on the move and make them someone else's problem," Breedlove said.

Turkey, which borders Syria to the north, "Hosts the largest number of refugees worldwide," according to the United Nations. Millions of refugees passed through Turkey's northwest border with Greece and Bulgaria on their way into Europe, creating political turmoil in several countries. In recent weeks, Turkey has forced thousands out of major cities, according to a report by the New York Times.

In September, Erdoğan threatened to "open the gates" to allow Syrian refugees into Europe unless a "safe zone" was established along Turkey's border with Syria.

Despite being a member of NATO, Turkey has drifted toward the Kremlin's sphere of influence in recent years. Turkey's decision to purchase S-400 air defense systems from Russia rankled the United States and prompted President Trump to boot Turkey out of the F-35 Joint Strike Fighter program.