HIS sleeping bag around his shoulders, Khaled, a 28-year-old truck driver, sits in a corner of Victoria Square, a gathering point for migrants in central Athens. He is waiting for a smuggler to help him cross Greece’s northern border with Macedonia, closed since February 21st to Afghan migrants like him. Across the square, Mahmud, a restaurant manager who has come from Aleppo with his wife and three children, fears that the route to Germany may soon close for Syrians too. “We mustn’t get stuck in Greece,” he says firmly.

That may be hard to avoid. Last week Austria restricted arrivals to 3,200 per day, of whom 80 may apply for asylum. Macedonia, Serbia and Croatia are clamping down too. By February 23rd a backlog of 4,000 migrants had gathered at the Greek-Macedonian frontier; Greek police turned back dozens of buses carrying new arrivals. On February 24th ten countries along the migration route met in Vienna to discuss further steps. Greece was not invited. At the port of Piraeus, where ferries bring the migrants who arrive in Greece’s Aegean islands, aid workers urged Afghans to remain in government-run reception facilities rather than attempt the journey north.

For months experts have warned that if northern Europe restricts refugee flows without an overall plan for handling migration, Greece faces disaster. The United Nations predicts 1m arrivals this year. Alexis Tsipras, the prime minister, worries that Greece will become “a black box” for migrants. As razor wire goes up across the Balkans, his fears may be about to come true.

The crisis could hardly have come at worse moment for Mr Tsipras. His left-wing Syriza government faces a revolt by lawyers, doctors and farmers against reforms demanded by Greece’s international creditors. Farmers angry at moves to raise their income taxes to the same level as other Greeks blocked highways with their tractors, closing border crossings with Bulgaria and Turkey. A meeting on February 22nd with Mr Tsipras proved fruitless. Two days later the supreme court prosecutor threatened to investigate protest leaders; the blockades were quickly removed.

While the farmers’ rebellion may have been crushed, lawyers are on strike over a new pension scheme, which they say would force them to pay more than 30% of their income in employee contributions. George Katrougalos, the labour minister, wants to raise employers’ contributions instead, claiming that pensions are among the last income sources for Greek families hit by the country’s long recession. But Greece’s creditors from the EU and International Monetary Fund say the pension system is on the verge of bankruptcy. They want an across-the-board benefits cut of at least 10% before releasing the next tranche of funding from the €86 billion ($95 billion) bail-out Greece concluded last year.

That leaves the Greek government on the edge of insolvency as the migrant crisis is about to explode. Two decades ago Greece comfortably absorbed almost 1m economic migrants from the Balkans. This time, after six years of recession, the unemployment rate is above 25%. Mr Tsipras’s inexperienced government has struggled to take care of migrants in transit, let alone provide facilities for those who stay longer than a few days. It took a threat of immediate expulsion from the EU’s passport-free Schengen zone before Greece fulfilled its obligation to provide “hotspots” on five islands where migrants could be processed according to EU regulations. With local mayors raising “not-in-my-backyard” objections, nothing happened until the defence ministry took over; army contractors built the facilities in less than a month.

Greece has already agreed to host up to 60,000 asylum-seekers who enter an official programme to relocate them to other EU countries. So far most have ignored the offer and pressed on with the journey. In any case, according to current plans, EU countries would take in only 13,000 migrants from Greece in the next six months. Some in Syriza used to argue that providing poor facilities for migrants would encourage them to move along. But thousands of Tunisians, Moroccans and Pakistanis blocked at the Macedonian border earlier this month are now settling in. Greece cannot afford to deport them.