Like Neal Ascherson, I recently revisited Gdańsk. The last time I was there was in August 1983, three years after the Gdańsk Agreement, the Communist Party’s abortive deal with the Solidarity trade union movement. Protests were expected. I was 19, and still had a few weeks left before university. It seemed sensible to lend a hand.

I was detained several times by the ZOMO riot police, and once found myself marching beside Lech Wałęsa. But it was a lull in the action that came to mind most often last week. At one point in 1983, as protesters around me contemptuously tossed złoty coins towards ZOMO officers, a wall of shields advanced and we were all swept into a subway. Smiling nervously at a priest who ended up next to me, I heard him murmur something like a prayer. When I explained that I spoke only English, his eyes widened. ‘England?’ he repeated. Reaching for my wavy black hair, he pressed a curl between his fingers. ‘But you are … nigger?’

As a half-Finnish, half-Pakistani Londoner, I wasn’t sure how offended to feel. The remark wasn’t malicious, and it was laughable compared to the racism then commonplace in England. It made me wonder about Poland’s us-and-them scale though, and similar questions about the struggle for self-determination loomed up again during my return, in the shadows of another demonstration that happened to coincide with my visit: one which the baffled priest of 1983 might even have attended. To commemorate the Battle of Lepanto – a 1571 naval victory over the Ottomans by a Venetian and Spanish-dominated fleet, somewhere near Greece – Catholics across Poland headed for the borders on 7 October to recite the rosary. Along the Baltic shore, at frontier posts, and in the chapels of three international airports, several hundred thousand people gathered to seek the Virgin’s protection – and her help in staving off a renewed Muslim threat. ‘A religious war between Christianity and Islam is once again underway in Europe,’ one of the event’s promoters said.

Statistically, the risks look low: Muslims make up less than 0.1 per cent of Poland’s population. The ruling Law and Justice Party is elevating Islamophobia into a governing principle, all the same: in tandem with like-minded nationalists in Hungary, its leaders warn that disease-ridden and violent Muslims are corroding Christendom (abetted by Western liberals and Jews like George Soros). The foreign minister recently told Russian radio that Poland was prepared to accept European immigrants, but drew a line at people from Africa and the Middle East. There have also been attacks on the independence of the judiciary and the media, and institutional dovetailing that’s starting to look distinctly theocratic. Participants in the recent prayer demonstration were sponsored by major corporations; railway tickets to border churches were subsidised at taxpayers’ expense; the prime minister tweeted a supportive cyber-rosary. Whatever the Virgin may or may not do to enemy aliens, her followers are being mobilised for action.

It was dispiriting to see authoritarianism and xenophobia resurgent, but it wasn’t much of a surprise. In a country that’s been invaded and subjugated as often as Poland has, warnings against hostile outsiders resonate. Attitudes I came to admire immensely in 1983 – a contempt for Soviet meddling, a faith in Communism’s fragility – were themselves the product of nationalism and intense piety. Galvanising state machinery to keep out refugees isn’t at all as brave, but some patriots always think otherwise.

Gdańsk takes pride in its relatively welcoming approach. Though it has form when it comes to ethnic cleansing, having been its victim in 1939 and its product since 1945, the city’s liberal mayor is keen to portray the seaport as a multicultural haven, and the citizens I met this time round weren’t just polite; many were highly critical of their country’s rightward lurch. I also enjoyed lounging around the speakeasies and underground clubs that have sprouted in the derelict shipyards where Communism died. But the liberalism of Gdańsk has definite limits. The entrance to a disused Jewish cemetery in the city’s suburbs was disfigured by a swastika; a member of the synagogue’s seventy-strong congregation told me that this was ‘normal’.

Poland, as elsewhere, is a place where bigotry doesn’t need targets so much as an audience. I spoke to Rafal Pankowski, the co-founder of an organisation called Nigdy Więcej (‘Never Again’). ‘Anti-Semitism without Jews has thrived in Poland for decades,’ he said, ‘and Islamophobia without Muslims has now been added to the political agenda.’ One day, I’ll go back to see how that’s working out.