Court: Abdul Rahman Haroun has admitted obstructing an engine or carriage

A Sudanese asylum seeker was today sentenced to nine months in prison after he was caught walking through the Channel Tunnel to get to Britain - but was allowed to walk free from court.

Abdul Rahman Haroun was arrested after he walked from Calais to Folkestone, Kent in August last year.

The incident came during a time of mounting chaos at the French port, as thousands of would-be migrants camped out hoping to make it to the UK in order to claim asylum or seek work.

Haroun's offence of 'obstructing an engine or carriage' on a railway line is punishable by up to two years in prison under a Victorian-era law.

He was today given a nine-month sentence, but will not have to serve any time in jail because of the months he previously spent in detention before being granted asylum.

The 40-year-old was given permission to stay in Britain last December after telling immigration officials that his life would be in danger if he stayed in Sudan.

The Crown Prosecution Service spent several months deciding whether or not to charge him over the way he entered the UK.

Eventually prosecutors decided to draw on the obscure Malicious Damage Act 1861, most of which has now been repealed, in order to press charges.

Haroun was set to face a trial at Canterbury Crown Court, but during today's hearing he changed his plea to guilty at the last minute.

He told immigration officers that travelling to Britain was the 'only solution' because of the dangers he faced in his own country, which has been riven with war for more than a decade.

But earlier this year, Haroun suggested that he 'would not have come' to the UK if he had known he would face arrest as a result of his dangerous journey.

Eurotunnel bosses and Conservative MPs welcomed the decision to prosecute the migrant, arguing that it was the only way to deter others from risking their lives on the railway lines.

Haroun took around ten hours to walk the 31-mile length of the tunnel under the English Channel, which carries Eurostar and Le Shuttle passenger trains as well as freight traffic.

The incident prompted severe delays on the line as French police searched the tunnel after seeing the asylum seeker enter it on CCTV.

Guilty: Abdul Rahman Haroun walked through the Channel Tunnel from Calais in order to reach Britain

Prosecutor Philip Bennetts QC told the court: 'He was asked how he had got into the tunnel and he said "I came from France, always trying to get here."'

He said he jumped over the perimeter fence by himself before 'walking sometimes on the right and sometimes on the left' inside the tunnel, Mr Bennetts added.

Up until then, his journey had involved travelling for a month to Egypt, then Libya before crossing the sea to Italy, a previous hearing was told. He then made his way to France and Calais.

In an interview with the Home Office, Haroun described how he had been persecuted by the Janjaweed militia, forcing him to flee his home in 2004.

He ended up in a camp at the Kari-Yari dam on the Sudan-Chad border where he was said to have spent many years living in difficult circumstances, the previous hearing was told.

After reaching France, Haroun spent up to seven days in Calais before walking through the tunnel.

Speaking through an interpreter, he told police following his arrest: 'I came here for protection and to be safe. Even if I die - that was the only solution.'

Asked how he knew the way to Britain, he said: 'All my family, all my people knew all along that the trains take you to the UK.'

Mr Bennetts said Haroun pleaded not guilty to the obstruction charge at Medway magistrates' court on August 6 last year, before the decision to grant him asylum led prosecutors to consider withdrawing the charge.

The security breach by Haroun had caused 'significant disruption' and a 'significant economic consequence' and led to delays of up to four hours for cross-Channel travellers, the court heard.

Richard Thomas, defending, said: 'He is a man who had no formal education. He speaks in a localised dialect and understanding the complexities has caused significant difficulties.'

Sentencing, Judge Adele Williams said today: 'Those who try to enter the UK illegally using unlawful methods commit a serious offence.

'The reason why the courts of the United Kingdom takes such a serious view of this criminality, is that those who enter in this way, normally, so so clandestinely, seeking to evade the authorities who can therefore, have no check upon who is entering.

'In the world in which we live of international crime and terrorism that is a very serious matter.

'You not only put your own life in danger but in my judgement, you put the lives and safety of others in danger. It caused enormous inconvenience to a large number of people. It causes significant economic loss.

'In these circumstances I am going to pass a sentence of imprisonment which is the equivalent of the amount of time which you have already spent in custody.

'Anyone else who might be tempted to commit this offence in the future can only expect any immediate sentence of imprisonment.'

French and British authorities have spent millions of pounds trying to bolster security at Calais after the port became a magnet for migrants from the Middle East and Africa.