Sudanese migrant Abdul Haroun leaves the Crown Court in Canterbury, Britain January 21, 2016. Haroun made global headlines in August when he walked 50 km (30 miles) through the Channel Tunnel from France to England, highlighting the plight of migrants, has been granted asylum in Britain. REUTERS/Stefan Wermuth

A Sudanese man was handed a jail term in Britain Wednesday after walking through the Channel Tunnel from France last year.

Abdul Rahman Haroun, who has been granted asylum in Britain, was sentenced to nine months in prison for causing an obstruction on a railway.

But he walked free from court because of time he has already served in custody.

His case made headlines because it highlighted fears that thousands of migrants who gathered at makeshift camps in northern France would try and cross over into Britain.

Presiding judge Adele Williams acknowledged that he had acted “in a state of desperation”.

But she added: “You not only put your own life in danger but, in my judgement, you put the lives and safety of others in danger.”

Haroun, 40, was arrested in Kent, southeast England, last August on suspicion of passing through the 31-mile (50-kilometre) tunnel, which carries trains between Britain and France.