Viktor Orban has been behaving like a classic realpolitiker: instead of cooperating closely with the EU in its time of crisis, he has chosen to develop contacts with rich and generous regional powers from the East which do not impose any political commitments on his country let alone show interest in its constitutional transformation.

Shaken by its poor economic and angry at the EU's criticism his reforms, Orban's Hungary has been chatting up non-democratic states that demonstrate an openness for investment and financial aid. This eastern focus already enjoys a firm conceptual footing—the so-called Eastern Wind doctrine.

Over the last two years, Budapest’s reinforced diplomatic efforts have run from the Northeast through Central Asia and Transcaucasia to the Persian Gulf. Missions of high officials made visits to Brunei, China, Georgia, Kazakhstan, Malaysia, the Philippines, Russia, Saudi Arabia, Thailand, Turkmenistan, United Arab Emirates, Uzbekistan.

Azerbaijan too has featured prominently. It is not hard to see why. In 2011 the value of Hungary’s trade exchange with Azerbaijan (€52.8mn) was twice as big as with Georgia and almost five times higher than with Armenia.

Orban himself was twice in Baku, and his collaborators more often. One of his closest confidants, Peter Szijjarto, was promoted to the position of vice-chairman of the Hungarian-Azerbaijani Intergovernmental Economic Commission.

The intensification of Hungarian-Azerbaijani relations has been especially noticeable in the last few months. In May, the Hungarian Economic Center was established in Baku with the aim of supporting small- and medium-sized businesses. A month later, Orban went to Azerbaijan to meet president Ilham Aliyev, a move reciprocated by Szijjarto in July. At the end of August, the weekly Figyelo revealed that Baku had agreed to buy Hungary’s public bonds worth €2-3 billion.

And it is not just narrow economic interests that drive the government. Security issues play a role too. In September 2010, Orban brought Hungary into the Azerbaijani-Georgian-Romanian project of AGRI pipeline. In the same breath he maintains his support for the Nabucco pipeline, which is the second possible route for Azerbaijani gas to Europe.

The decision of his government to release Ramil Safarov, a former lieutenant in the Azerbaijani army, who was sentenced to life imprisonment on charges of premeditated murder with extreme cruelty of an Armenian colleague, seemed to be the natural further step in deepening friendly relations with Baku.

However, no one in Budapest predicted that this would result in an immediate and firm reaction by Armenia, which severed diplomatic ties with Hungary and put the army on a state of alert toward its neighbour Azerbaijan, with whom it is locked in a frozen conflict.

The first declarations from Budapest suggest that Hungarian authorities were not quite aware of the geopolitical consequences of this prisoner transfer. They acted in accordance with the relevant Convention of the Council of Europe. But so did Aliyev, who not only pardoned Safarov—the new national hero in Azerbaijan—but also promoted him to the rank of major and gave him a flat.

No matter, Hungary is already the greatest loser in the affair. If it is true that Budapest has been cheated by Aliyev, who promised that Safarov’s sentence would be continued in Baku, Orban’s naivety will be brought to light. It will call into question the government’s competence to carry out the policy of such a broad opening to the East.

Orban might, of course, receive an apology from Azerbaijan in the form of further economic concessions, but this in turn will have a very negative impact on the country’s image in the West, making it extremely hard for Hungary to throw off its reputation as a country that subordinates its foreign policy to economic interests.

Moreover, if blame does shift to Baku, a worse scenario may come to pass. Its machinations could be cited by Armenia in order to awaken the frozen Azerbaijani-Armenian conflict in Nagorno-Karabakh. For Orban—it would be an image and political catastrophe.

The best hope is for Budapest to maintain the ambiguity about who is responsible – hardly the behaviour of a reliable European partner.

The writer is an analyst at the Polish Institute of International Affairs in Warsaw