Hungarian Prime Minister Viktor Orban pledged his support for Turkey's plans for a so-called safe zone in northern Syria on Thursday during an official visit from Turkish President Recep Tayyip Erdogan.

"Turkey can count on our support within the best of our abilities," Orban said during a joint press conference in Budapest, referencing Ankara's plans to rebuild areas it now occupies following a military operation against Kurdish militia groups in the region.

Turkey said it plans to send at least 1 million of the around 3.6 million Syrian refugees that it has been hosting to the area.

Watch video 01:54 Share EU migrant pact with Turkey Send Facebook google+ Whatsapp Tumblr linkedin stumble Digg reddit Newsvine Permalink https://p.dw.com/p/3RRTq Explained: Turkey's threat to flood EU with migrants

On Thursday, Erdogan also repeated his frequently issued threat to open the border for Syrian refugees looking to travel to Europe unless the EU provides Ankara with the rest of the funds promised under a refugee deal.

"Naturally, we will continue to host our guests whether or not we get the EU support," Erdogan said. "But if there is no solution, we have to open our gates. If we open our gates ... everyone knows where they would go."

Several hundred people, including anti-war and pro-Kurdish activists, protested against Erdogan's visit by marching in Budapest.

Turkey as immigration ally

For Erdogan, Orban represents a key ally in the European Union. Unlike other EU leaders who slammed Turkey's military offensive against the Kurdish militia, Orban praised it.

Last month, Orban delayed a joint EU statement condemning Turkey's military offensive in northern Syria against Kurdish forces.

That backing was noted by Erdogan, who recently thanked Orban for the "support" on the international stage.

Watch video 03:31 Share Concern over Syria 'safe zone' Send Facebook google+ Whatsapp Tumblr linkedin stumble Digg reddit Newsvine Permalink https://p.dw.com/p/3RVH1 Refugees skeptical about safety of Syria 'safe zone'

Orban, whose anti-immigration policies have led to clashes with Brussels, reacted to Erdogan's refugee threat by calling the Turkish leader an important strategic partner in security and migration issues.

"Without Turkey, migration toward Europe cannot be stopped," Orban said.

An unusual friendship

With Orban and Erdogan describing each other in public as "dear and good personal friends," it's clear the two strongmen enjoy a close personal relationship.

What's not as clear is exactly what Hungary gets in return for Orban's close ties with Erdogan.

Although the two countries agreed in 2013 to increase bilateral trade to $5 billion (€4.5 billion), they have yet to reach that goal, with trade volume amounting to around $3 billion last year, reported German magazine Der Spiegel.

Turkey is far from being one of Hungary's most important economic partners, but as Orban looks to build up the country's military, his government will likely look to buy weapons in Turkey, according to Der Spiegel.

Hungarian officials have said they expect to draw natural gas from Turkey's TurkStream pipeline by the end of 2021 — a key way for the country to diversify transit routes for its energy supplies, which currently primarily come from Russia.

Besides Turkey, Orban's nationalist government has forged close relations with Russia, China and several ex-Soviet states in Middle Asia in recent years.

Watch video 06:15 Share Hungary: 30 years after the Iron Curtain Send Facebook google+ Whatsapp Tumblr linkedin stumble Digg reddit Newsvine Permalink https://p.dw.com/p/3NoGm Hungary: 30 years after the Iron Curtain

rs/sms (Reuters, dpa, AP)Every evening, DW's editors send out a selection of the day's hard news and quality feature journalism. You can sign up to receive it directly here.