was detained by French police after she was found on a bus

The top legal advisor to Europe's highest court dealt a fresh blow yesterday to David Cameron’s attempts to crack down on refugees trying to sneak into the UK.

As Britain faces a surge of asylum seekers seeking to enter from Calais, the European Court of Justice blasted France for detaining an illegal immigrant at the entrance to the Channel Tunnel.

The advisor's opinion said France was wrong to detain Ghanaian Selina Affum after she was caught trying to reach the UK using a false passport. Instead, she should have been released – giving her the chance to vanish.

Ghanaian Selina Affum stopped by French police at the Channel Tunnel entrance on a coach from Ghent in Belgium to London in March 2013 travelling with someone else’s Belgian passport. Pictured: 'The Jungle'

Critics said the ‘farcical’ decision would provide new encouragement for people from outside Europe who want to slip into Britain unlawfully.

The decision may also complicate efforts to stop migrants moving unhampered across Europe’s passport-free Schengen zone and heading for the French port.

And it could have significant implications for how the French and British guard Calais. Up to 7,000 migrants are holed up in The Jungle shanty town there, using it as a springboard for illegal entry to the UK.

Ms Affum was stopped by French police at the Channel Tunnel entrance on a coach from Ghent in Belgium to London in March 2013. She was travelling with someone else’s Belgian passport and had no other travel documents.

She was put in police custody on the grounds that she was an illegal entrant and held in jail while officials waited to send her back to Belgium. Under French law, illegal entry can be punished with up to a year in prison. But an opinion by the Advocate General to the European Court of Justice (ECJ), Maciej Szpunar, said France had no right to detain her under EU rules for being an illegal entrant.

An EU directive allows the imprisonment of illegal immigrants only if they have already been booted out and are attempting to re-enter a country. They can also be locked up if moves to kick them out have been started and they resist.

In addition, she could not be detained while deportation proceedings were being started.

But the European Court of Justice's Advocate General blasted France for detaining her at the entrance to the Channel Tunnel. Pictured: Migrants make their way through a fence near the Tunnel, in Frethun, near Calais

Advocate General Szpunar said: ‘A third party country national such as Ms Affum cannot be imprisoned solely on the basis that she is illegally in the territory of a member state.’

Because of the number of migrants in northern France, authorities do not routinely lock people up for false travel documents.

The ECJ will now consider the matter before making a judgment, but it rarely overturns an Advocate General’s opinion.

LABOUR: LET THEM ALL IN All illegal immigrants should be given a UK passport and Britain should embrace ‘open borders’, Shadow Chancellor John McDonnell has said. Mr McDonnell, who is Labour leader Jeremy Corbyn’s close political ally and friend, was questioned at the weekend on his past statements on immigration as he warned that borders would become ‘irrelevant’. The hard-Left MP said in a speech three years ago that free movement across borders was a ‘basic human right’ and everyone should be allowed to ‘travel right the way across the globe’. In another public address he declared ‘no one is illegal’ when it came to immigrants and all workers should have the ‘dignity of full citizenship’. The remarks sparked astonishment last night, as Tory MPs warned that Labour lacked a ‘basic grasp of reality’. Andrew Bridgen MP said: ‘Calling for open borders is ludicrous.’ Advertisement

The opinion is a blow to the Prime Minister ahead of the EU referendum, with controlling Britain’s borders a key issue for voters.

Ukip deputy leader Paul Nuttall said: ‘On the day of Cameron’s phantom renegotiation the British people receive a kick in the teeth from an EU court. Cameron has not even asked for treaty change, and whatever is agreed politically by him will be judged according to the existing treaties by the ECJ.

‘This judgment shows that while the UK is a member of the EU we have absolutely no chance of controlling our borders.’

Alp Mehmet, of Migrationwatch, which campaigns for managed migration, added: ‘This flies in the face of common sense – it is a ridiculous, farcical judgment. The EU’s migration policies are a disaster and this will make it even worse. It underlines, if ever it were needed, why the UK should never have anything to do with a Schengen-type arrangement.

‘This is yet another ECJ judgment which jeopardises our ability to control entry to the UK.’

Yesterday’s ECJ opinion is likely to trigger concern among EU countries, some of whom are already questioning whether their open-border policy can be maintained in the face of the refugee crisis.

A Home Office spokesman said: ‘The UK is not part of the Schengen zone. However, all passengers undergo full checks at passport control making the UK’s border one of the most secure in the world. Border Force officers will always refuse people access to the UK if they are not satisfied they have a right to enter.’

Many people in Calais are fleeing humanitarian disasters in Africa and the Middle East, but often they are economic migrants.

On Friday, Britain’s most senior immigration judge said many in the Calais Jungle were not refugees but heading to Britain for its ‘advantages’. Mr Justice McCloskey made his comments following a ruling that four Syrians in the camp had a human right to be reunited with family in the UK legally.