Hungary's Foreign Minister Péter Szijjártó | Attila Kisbenedek/AFP via Getty Images Hungarian minister appears to endorse Turkish incursion into Syria Péter Szijjártó says the most important thing is to protect Hungarian interests and stop migration.

Hungary's foreign minister on Tuesday said his country supports Turkey's plan to move refugees into Syria, contradicting the EU's formal opposition to Ankara's military incursion.

The Hungarian government only considers one thing when it comes to Turkey's actions in Syria, Foreign Minister Péter Szijjártó told Hungarian state media during a visit to Azerbaijan, and that is Hungary's national interest, which is to stop migration.

"If the question for us Hungarians is put like this, 'what would we like, if Turkey would resettle the migrants in Syria, or would open the doors in Europe's direction?' then our answer is clear," the minister said, adding that Turkey should resettle migrants in Syria.

Hungary will happily work with Turkey if it creates a safe zone in Syria where families who left the country could be resettled, the minister said.

The EU's formal position is that Turkey should immediately end its operations in northern Syria, and European Commission President Jean-Claude Juncker has said: “If the plan involves the creation of a so-called safe zone, don’t expect the EU to pay for any of it.”

"The EU calls upon Turkey to cease the unilateral military action,” Federica Mogherini, the EU's foreign policy chief, said in a statement on behalf of the bloc last week.

“If the plan involves the creation of a so-called safe zone, don’t expect the EU to pay for any of it" — Jean-Claude Juncker

“Military action will indeed undermine the security of the coalition’s local partners and risk protracted instability in northeast Syria, providing fertile ground for the resurgence of Daesh,” Mogherini said, using the Arabic acronym for ISIS. She added that “any attempt at demographic change would be unacceptable. The EU will not provide stabilization or development assistance in areas where the rights of local populations are ignored.”

The Hungarian foreign minister was in Baku accompanying Prime Minister Viktor Orbán to the Turkic Council. On Monday, Orbán held talks with Turkish President Recep Tayyip Erdoğan.

The Turkish leader "expressed his gratitude for the fact that Hungary stands up for Turkey on the international scene," a spokesperson for Orbán said after the meeting.

The Turkish leader is scheduled to visit Budapest on November 7.