As Turkish President Erdogan has threatened Europe with releasing as many as 3 million new migrants, Bulgaria has stepped up its plans of adding a 20-mile-long wall along its border with Greece and Turkey.

Bulgarian authorities have expressed concerns that the closing of Macedonia’s border with Greece might drive migrants to enter the EU en masse through Bulgaria, if Erdogan carries out his threats.

The challenge, said Bulgarian Prime Minister Boyko Borisov, “is not only to keep the channel of communication with Ankara open, but also to ensure that Turkey will not allow the free passage of refugees to Bulgaria.”

Erdogan has said that Ankara will annul its agreement with the European Union (EU) to restrain migrations into Greece if the EU does not lift its visa requirements by October, allowing Turkish citizens to travel freely throughout Europe.

Turkey is home to some 2.8 million Syrian refugees alone, without counting the many thousands of Afghans and Iraqis who are anxious to get into Europe.

“The European Union is not acting sincerely with Turkey,” Erdogan said in a recent interview with the French daily Le Monde. “We have taken in 3 million refugees, whereas the EU’s only concern is keeping them out of its territory.”

The Turkish President has been using the prospect of new waves of millions of migrants to pressure Brussels into accepting his demand that Turkish citizens be allowed to enter Europe freely without visas, which he sees as a first step toward eventual Turkish membership in the EU.

Angelino Alfano, Italy’s Minister of the Interior, said that if Turkey were to carry out its threat, the fallout for Europe could be catastrophic.

“It is clear that if Turkey were to open the floodgates it would be devastating for the whole of Europe,” Alfano said, while urging EU members to remain on high alert. “Turkey has a refugee population in the millions on its territory,” he noted.

Bulgarian border officials are reportedly carrying out daily arrests of some 150-200 refugees who enter the country illegally, sending them back to Turkey. If Ankara refuses to take back illegal migrants as the Turkish president has promised, Bulgaria would have to find a way to assimilate the migrants on its own.

The number of migrants crossing the Aegean Sea from Turkey to the Greek islands has already increased dramatically ever since the recent coup attempt in Turkey. Now Bulgaria faces fears of an uncontrolled influx of migrants arriving from the country and has pushed forward the construction of its border wall, which will be nearly 12 feet tall.

In the last two weeks of July, 1170 migrants crossed from Turkey to the Greek Islands, as compared with just 560 during the fifteen days prior to the coup, which many are seeing as a taste of things to come. In the last week, the numbers of crossings have continued apace with no sign of abating.

Analysts note that the recent surge in immigration cannot simply be explained by the advance of summer or weather conditions, but undoubtedly relates to the political situation within Turkey.

European immigration from Turkey had slowed to a trickle after last March, when the European Union entered into a refugee agreement with the Turkish government.

Greek media report a growing concern among local authorities in the face of new waves of migrants arriving on its shores, and Greek Prime Minister Alexis Tsipras has returned to Athens to assess the situation and devise practical solutions in the coming days.

The Bulgarian prime minister will meet with Turkish President Erdogan on August 24 in Ankara in an attempt to come to some sort of agreement over the migrant crisis, but meanwhile, the wall-building continues.

Follow Thomas D. Williams on Twitter Follow @tdwilliamsrome