Nigerian comic actor Babatunde Omidina, popularly known by his stage name Baba Suwe, has been freed on bail in Lagos.
He was detained on suspicion of drug trafficking on 12 October after a body scanner at Lagos airport identified suspected drugs in his stomach.
But after more than three weeks in jail, officials from the National Drug Law Enforcement Agency (NDLEA) admitted he had failed to excrete any drugs.
His fans and supporters cheered as he left the building after the hearing.
His bail had been set at $3,300 (£2,000).
"There have been several examinations carried out on him and no banned substances have so far been found," his lawyer Bamidele Aturu told the court.
Baba Suwe is a famous comedian in Nigeria's film industry, known as Nollywood, and his arrest shocked many of his fans.
He acts in both English and Yoruba language films, often playing the role of a befuddled butler or security guard.