Rhymes is known for hits including Put Your Hands Where My Eyes Could See
A High Court judge has ordered the immediate release of US rapper Busta Rhymes after he was detained at London's City Airport.
The 36-year-old was held after being refused entry to the UK because of "unresolved convictions" in the US.
The star had flown to the UK ahead of a charity performance on Friday.
Immigration officials initially tried to put him on an immediate flight to Amsterdam, but Rhymes's lawyer secured an injunction preventing that.
Mr Justice Flaux granted an injunction by telephone to prevent Rhymes - real name Trevor George Smith Jr - from being sent to the Netherlands.
He was told the rapper had been kept in a room measuring 7ft by 8ft under the eyes of five armed police officers.
Ruling it was arguable that Rhymes's detention was unlawful, he said: "It seems to me that it is difficult to see upon what basis the temporary admission of the claimant or his temporary release into the jurisdiction has been refused.
"In all the circumstances it seems to me that he is entitled to an order that he be released forthwith or alternatively is entitled to bail."
He said the rapper intended to stay at a hotel in London until the concert, before returning to the US on Saturday morning.
Rhymes is due to play at Orange RockCorps, a concert to be attended by a full house of 5,000 music fans at the Royal Albert Hall in London.
Each fan has obtained their ticket by spending four hours volunteering in community projects.
Rapper Ludacris had been lined up to perform at the gig to replace Rhymes
Rhymes, who has already been allowed entry to the UK twice this year, has a valid work permit for the concert.
His lawyer, Amanda Weston, argued the basis on which Rhymes had been refused entry was incorrect.
She argued the offences of assault and drink driving of which he had been convicted in the US constituted "misdemeanours" under New York criminal law rather than "felonies".
Jeremy Johnson, counsel for the Home Office, told the judge the question of whether to refuse entry was being reconsidered on revised grounds, rather than on the basis of the erroneous information received.
The judge concluded that Ms Weston had established a sufficiently arguable case that the refusal to permit entry was unlawful, so that it followed that it was also arguable that the decision to detain was unlawful.
A hearing at the High Court on Friday will focus on the legality of the decision to refuse entry.
Earlier Stephen Greene, the co-founder of RockCorps, had said he was "shocked at this sequence of events and this treatment of Busta".
"He has the necessary work-permit and has been in the country twice already this year, so we're a little puzzled that a question mark is now being placed over his ability to enter the country to perform to volunteers."
Rapper Ludacris had been lined up to replace Rhymes on the bill if necessary, Mr Greene added.