An illegal immigrant walked free from court after the police failed to submit the form which would ensure his deportation.o Quang Duy Bui, a 19-year-old from Vietnam, cried at Oxford Crown Court yesterday when he heard he would be released after admitting cultivating a class C drug. Recorder Guy Hungerford sentenced him to five months in custody after hearing that Bui had tended to 228 cannabis plants in Lenthall Road, Rose Hill, Oxford.

Mr Hungerford said Bui would serve half the sentence in custody and half in the community. He was therefore eligible for immediate release because he had already spent 82 days in jail.

Having heard that Bui's bid to stay in the country had failed in 2004 after he entered the country illegally, Mr Hungerford said: "I make no order for your deportation because the appropriate documents have not been served, but it is likely that the Home Office will deport you in due course."

A deportation order would have meant that Bui could be detained by the immigration services until he was removed from the country.

But an order could only be made if the police had issued Bui with an IM3 form, notifying him that he could be deported. Chief Supt Dave McWhirter said the force had failed to do so because Bui had been recorded as a British national on their system. He said: "We do apologise for the error but there is no doubting our commitment to working with the Immigration Service on the issue of illegal immigrants.

"We will be looking into this case and seeing what can be done to rectify the situation."

Police arrested Bui on June 21 after getting a warrant to search the three-bedroom house where he was looking after the plants.

Sophie Eloquin, prosecuting, told the court that almost every room of the house was packed with more than 200 cannabis plants, as well as heating, lighting and ventilation equipment.

She said Bui told officers that he had been given lodgings and £100 to take care of the plants by a Mr Huey, who he had met in London three weeks earlier.

Rachel Drake, defending, said her client was one of those that "simply do what they are told by the main mover. My client has been exploited". She added: "This defendant is clearly a foot soldier."

Mr Hungerford, sentencing, described cultivation of cannabis as a very serious offence, but said he was taking into account Bui's age, previous good character, and the fact that he had played a minor part in the operation.

The deportation of foreign prisoners became a hot topic after it was revealed that the Home Office had released prisoners who should have been deported. It led to the sacking of Home Secretary Charles Clarke in May.