WARSAW — A six-hour private meeting on Wednesday between Jarosław Kaczyński, leader of Poland’s ruling Law and Justice party, and Hungarian Prime Minister Viktor Orbán in southern Poland brought together the two men who have most roiled European politics of late.

The meeting was held over a meal of sour soup and trout in the shadow of a castle that switched hands over the centuries between Hungary and Poland. The pair weren't close in the past. When Orbán was in Warsaw in 2015, he didn’t even see Kaczyński, who was reportedly dismayed at the Hungarian leader’s close ties with Russia’s Vladimir Putin.

But they now have an enemy in common — the foreign critics in Brussels, Berlin and beyond who have lambasted them both for allegedly trampling on European democratic norms — and an increasingly similar political philosophy and approach to governing. With each week, the parallels between Law and Justice (or PiS, as it's known by its Polish acronym) and Orbán are coming into sharper relief.

Nationalist rhetoric, socialist economics

On the Polish right, Orbán has been the object of “fascination” since his Fidesz party came to power in 2010 with almost 53 percent of the vote, said Igor Janke, author of an influential Polish book, "Attacker: A Tale of Viktor Orbán." Not only politicians from Law and Justice, he said. Some in the rival Civic Platform party felt it as well. When Donald Tusk was Poland’s prime minister from 2007 to 2014, he often went out of his way to defend his Hungarian counterpart from Western attacks.

What captivated the Polish right most of all was Orbán’s efficacy, both at winning elections and reforming the country — the impression that “politics can get things done,” Janke said.

Orbán's nationalism plays to the country’s historic sense of grievance over a World War I settlement that left it shorn of many ethnically Hungarian territories. He also defends politically incorrect views, warning that the hundreds of thousands of mainly Muslim migrants arriving in the EU threaten the continent’s “Christian” roots.

To the frustration of his critics, Hungary last year had one of the fastest growth rates in the EU.

His economic policies lean populist, as does Poland's new government. He promised and delivered on relief for the thousands of Hungarians who had costly mortgages denominated in Swiss francs. His unorthodox economic policies, dubbed “Orbanomics,” imposed special taxes on many big businesses, in particular non-Hungarian ones.

To the frustration of his critics, Hungary last year had one of the fastest growth rates in the EU.

Orbán has come under fire for imposing tighter controls on state radio and television broadcasters and for funneling state advertising contracts to friendly media. The Hungarian leader, who has said one of his goals is to build an “illiberal new state based on national foundations,” also limited the power of the constitutional court to strike down laws passed by parliament.

In Poland, Kaczyński has railed against migrants carrying “parasites and protozoa.” His party appeals to a nationalist sense of grievance at the harm done to Poland during World War II. In a recent television interview, Kaczyński pointed out that most Poles had been killed “not by the Gestapo or the SS but by ordinary Germans.”

The PiS government elected in October sought to strengthen its hold over the Constitutional Tribunal by invalidating the choice of five judges by the previous parliament. Parliament, where PiS has an absolute majority, also pushed through a law that gives the government much tighter control of the public media. Both steps have been condemned by Brussels.

The party’s economic ideas are similar to Orbán’s. Andrzej Duda, the PiS-backed president, promised to help the half-million Poles with Swiss franc mortgages (although he hasn't yet followed through). The government wants to impose a special tax on big retail outlets (largely foreign owned) and a new banking tax. Its signature policy is a per-child bonus of 500 zlotys (€116) a month for families with two or more children.

Even so, Orbán’s actual influence on Law and Justice shouldn’t be exaggerated. Asked about how close Kaczyński is to Orbán, Janke quips that he knows each of them better than they know each other.

Attacked by Brussels

As far as the EU is concerned, Poland’s new leadership admires how Orbán has stood up for Hungary’s interests. While not opposed to EU membership, the new Polish government resents being bossed around by Brussels or Berlin on matters ranging from CO2 emissions to refugees.

At the same time, the Law and Justice government wants to deepen cooperation within East-Central Europe, which it feels was previously neglected in favor of relations with Paris and Berlin. In this view, the Visegrad Group — comprising Poland, Hungary, the Czech Republic and Slovakia — could form the core of a broader alliance stretching from the Baltic to the Black Sea, with Warsaw at the center.

Kaczyński’s party has a history of hawkishness towards Moscow, whereas Orbán has been accused of cozying up to the Kremlin.

Still, proponents of closer Visegrad cooperation recognize that it will not happen overnight. “It would be great if we were the Benelux – but we aren’t,” said Konrad Szymański, the new minister for European affairs, referring to the close-knit political and economic union of Belgium, the Netherlands and Luxembourg, at a recent event in Warsaw organized by the think-tank CEPA.

One problem is Russia. Kaczyński’s party has a history of hawkishness towards Moscow, whereas Orbán has been accused of cozying up to the Kremlin, which is helping finance a large nuclear project in Hungary.

Even further right, Polish-Hungarian camaraderie is used as a banner by nationalists united by a shared disdain for Western liberalism. Hostility to migrants is bringing Poland’s marginal National Movement and the nationalist Jobbik, the third-largest party in the Hungarian parliament, closer together.

There was a visible Hungarian presence at the annual nationalist march in Warsaw on Polish Independence Day, November 11. “Friendship today, alliance tomorrow,” read a bilingual banner carried by youths with Jobbik flags.

“Nowhere in the world is there such a tie between nations,” a Polish priest who supported the march said enthusiastically.

One of the guests at the Warsaw march was László Toroczkai, a Jobbik lawmaker and mayor of Ásotthalom, near Hungary’s border with Serbia.

“We are defending Europe from the Islamic invasion in exactly the same way as 500 years ago; and unfortunately, the West is silent in the same way as before,” he shouted from a makeshift stage behind Warsaw’s National Stadium, boasting about how the fence on Hungary’s border with Serbia had been his idea.

“Without Hungarian-Polish cooperation, Christian Europe will perish,” he yelled.

Jobbik’s cooperation with the tiny Polish National Movement is rooted in a shared vision of Europe, Márton Gyöngyösi, a leader of Jobbik responsible for foreign policy, told POLITICO.

“As opposed to liberal values based on individualism, secularism, consumerism and multiculturalism, we support the defense of the nation state, its traditions, ethnic composition and Christian values,” he said.

Polish-Hungarian relations are underpinned by a mythologized friendship. A centuries-old saying in both languages speaks of “Pole and Hungarian — two good friends, together they battle and drink.”

While the mutual admiration can be overstated, it is there.

“I am deeply convinced that the day will come when we will have Budapest in Warsaw," Kaczyński said after his party lost elections in 2011.