A District man accused of groping an 11-year-old girl last week at an Anacostia elementary school was released from custody in December while awaiting hearings in a robbery case against him, according to court records.

Davon Rashad Wood, 21, of the 2300 block of 24th St. SE, was arrested Wednesday on a second-degree child sexual abuse charge.

In December, Wood was arrested after being accused of robbing a Metro Transit officer in a decoy operation. Wood pleaded guilty to attempted robbery and was free, awaiting an April 9 sentencing, at the time of the elementary school incident.

According to a court affidavit made public Thursday, Wood entered Ketcham Elementary School on Feb 1. shortly before 3:30 p.m. He walked with a girl who was helping him find another student. As they walked, Wood hugged the girl around her neck. After she pushed him away, Wood grabbed the girl’s buttocks, a detective wrote in the affidavit.

The student ran and found a friend who urged her to report the incident, according to the affidavit. School officials notified the girl’s mother and the police.

A school employee knew Wood’s first name, according to the affidavit, and police later determined his full name and obtained his cellphone number. Wood willingly went to talk to police and said the girl who escorted him was helping him find a friend’s son.

Wood told police the girl flirted with him, asking him to hug her and thrusting her buttocks into his crotch, according to the affidavit. Wood later admitted touching the student, but said, “If it happened, it was a mistake.”

On Thursday, in his initial appearance in D.C. Superior Court, Wood was ordered jailed pending a Feb. 22 preliminary hearing.

In the robbery case, six plainclothes Metro Transit officers were at the Congress Heights Metro station about 3:30 p.m. on Dec. 7, according to court documents. Wood came into the station and saw a man — one of the officers — asleep on the platform with a smartphone in his right hand and $20 in the front left pocket of his jacket.

Wood asked another plainclothes officer how long the man had been sleeping there, according to court documents. “A couple of minutes,” he was told. Wood was arrested after he took the money from the man’s pocket.

When he was arrested, Wood told police the sleeping man had taken his money and he wanted it back.

labbet@washpost.com