“THIS is a nightmare, I want to go back to Syria,” says Youssef (not his real name), who has fled from his war-torn country and is now in a squalid refugee camp in south-eastern Bulgaria. He is shocked by the lack of urgently needed medical help, the scarcity of food—and the sight of crumbling old buildings where up to ten desperate families share a single room, and ten such rooms have the use of only one leaky toilet.

Youssef is one of thousands of Syrian refugees in Bulgaria, the poorest European Union country. Dozens more are crossing the border with Turkey every day. Around 10,000 migrants (two-thirds of them from Syria) have arrived so far this year, a sevenfold increase from last. Authorities have basic facilities ready for only half of them.

The influx caught the government unprepared. It is now rushing to build new shelters and improve the miserable conditions at the existing ones. It has asked the EU, the Red Cross and other international organisations for financial assistance.

The government is also building a controversial 33km (21-mile), 3-metre tall fence in the mountainous region of Elhovo, near the border with Turkey, where about 85% of the illegal immigrants are crossing. According to officials, the idea behind the “temporary engineering installation”, which has a price tag of €3m ($4m), is to redirect refugees to official border checkpoints. The UNHCR, the UN’s refugee agency, thinks it is counterproductive. “Introducing barriers, like fences or other deterrents, may lead people to undertake more dangerous crossings and further place the refugees at the mercy of smugglers,” says Adrian Edwards of the UNHCR.

Other European countries have erected similar barriers to deter immigrants from Africa and the Middle East. In October Turkey started building a 2-metre-high wall along part of its Syrian border. Last year Greece built a 10.5km barbed-wire fence at its border with Turkey. Because of the Greek wall, smugglers have increasingly concentrated on moving people into Bulgaria. “It seems that there will be a competition between the walls in Bulgaria and Greece,” says Tihomir Bezlov at the Centre for the Study of Democracy, in Sofia. “The main problem, as the experience with other borders shows, is that a wall cannot stop people who are ready to do anything.”

The wire fence is just one of a series of measures taken by the government in recent weeks that signal a tougher stance on illegal immigration. The interior ministry has sent a couple of thousand police officers to patrol the Turkish border and is planning to build “accommodation centres of the closed type”—a euphemism for prisons—for immigrants. In recent weeks Bulgaria has sent back hundreds of illegal immigrants from Syria, a move strongly criticised by the UNHCR.

The surge in refugees is igniting xenophobia in a traditionally tolerant society. On November 9th skinhead extremists beat up a Bulgarian Muslim, apparently mistaking him for a Syrian. Earlier in the month the stabbing of a 20-year-old shop clerk in the centre of Sofia led to the arrest of an illegal Algerian migrant a couple of days later and protests by nationalists.

Far-right parties are on the rise. According to a poll by Alpha Research, 83% of Bulgarians see the influx of refugees as a risk to national security. Support for Ataka, an ultranationalist party, which has 23 seats in parliament, has doubled in the past two months. And on November 9th a new nationalist party was founded, promising to “clean up the country of this scum, these immigrants”.