He was however granted N500,000 bail.
The Senior Magistrate, Mr Patrick Adekomaiya, also asked the accused to produce two sureties as part of the bail condition.
Adekomaiya said the sureties must be gainfully employed and should show evidence of two years tax payment to the Lagos State Government.
Yusuf, who has no fixed address , had pleaded not guilty to a two-count charge bordering on defilement and sexual assault
The prosecutor, Insp. Tony Elibeh, told the court that the accused committed the offences on April 17 at Rago Market, Ojo, Lagos.
Elibeh said that the accused lured the girl to the back of a building at the market place and forcefully had carnal knowledge of her without her consent.
“The accused was caught by a man, who saw him having carnal knowledge of the girl. The man immediately rescued the girl and called some market women to help her.
“The accused was badly beaten up by an angry mob, before the police came by to arrest him,” Elibeh said.
The prosecutor said the offences contravened Section 137 and 263 of the Criminal Law of Lagos State, 2011. Section 137 prescribes life imprisonment for child rape.
The Magistrate adjourned the case till Aug. 31, for mention.