Social workers who dealt with an 11-year-old boy who was sexually assaulted last May in his D.C. Superior Court cell were concerned about the boy's safety and took emergency steps to win his release, according to sources familiar with the incident. But the boy was assaulted before the workers could get him out of the cell.

The boy, who was charged with assault after he hit a friend on the head with a baseball bat, was interviewed in his cell, where he was being held with older youths. Sources said that social workers became concerned because they believed there was an obvious danger he might be harmed there.

The social workers prepared a seldom used order seeking the boy's release that went directly to deputy U.S. marshals holding the boy, sources said. Such release orders normally come from a judge or court clerk.

However, by the time the order had been prepared, the boy had already been assaulted by two cellmates and forced to commit sodomy. The boy, who is now 12, was later found to have contracted syphilis.

Mayor Marion Barry expressed concern yesterday over the May 24 incident and said he has ordered an administrative review to determine whether the police department or other agencies mishandled the situation.

"I'm awfully concerned about it myself," Barry said. "I want to find out what happened, why it happened and who made what decisions."

Barry summoned police officials and representatives of other city departments to an afternoon meeting and said he would withhold judgment until the review is completed.

The boy was arrested by 4th District police and charged with assault with a dangerous weapon after he struck a friend with a baseball bat. The boy said he was just horsing around when he "accidentally" hit his friend.

The injured boy suffered a deep cut on his head that required stitches, and his mother complained to police. Officers turned the 11-year-old over to deputy U.S. marshals at the courthouse, where he was placed in a cell pending a court hearing.

There he was assaulted by 14-year-old and 17-year-old cellmates who had several prior convictions.

Court records show that the boy was interviewed in the cell that morning by a social worker and that social workers noted that he had no criminal record and that the baseball bat injury "did not necessarily occur through a malicious intent." Social workers later began preparing the unusual release order, sources said.

According to police investigators, the boy was held in the cell for about 1 1/2 hours while his mother waited in the social services office upstairs in the courthouse.

"It's not something done very quickly," said one source close to he Marshals Service who is familiar with the release procedure.

The social workers involved declined to comment and court executive officer Larry Polansky, citing the confidentiality of juvenile matters, said he would not give them permission to talk on the record about their efforts in the case.

Sometime around noon that day -- after the boy had been assaulted -- a social worker returned to the cell to escort him out. The boy said he told the social worker that his shoes had been stolen by one of the youths in the cell but that he said nothing about the sexual assault until later that night, when he told his aunt about it.

The D.C. Corporation Counsel said one of the attackers later pleaded guilty to a charge of assault with intent to commit robbery, as well as to sodomy charges.

According to Daniel Arshack, the attorney for the boy's family, a social worker gave the boy's mother a notice to return to court a week later. Police said they did not learn of the assault in the cell until the next day, when the boy's mother alerted authorities.

Authorities in the juvenile justice system have questioned actions taken by city prosecutors in the case. A petition charging the 11-year-old with assaulting his friend with a baseball bat was signed by a prosecutor on the day the boy was placed in the cell, but it was not filed in court.

Asked earlier to explain why the petition was not filed, Corporation Counsel Inez Reid said prosecutors regarded the case as "serious" and had intended that day to ask the court for a customary five-day extension in which to file their papers.

But sources yesterday said that social workers had alerted prosecutors that they were having the boy released under the emergency procedures, and that under those circumstances there would be no opportunity to file for an extension.

"We don't do very much around here without communicating with each other," said one source familiar with relations between social services and prosecutors.

Prosecutors did not file the petition until a week later, days after learning of the sexual assault.

Reid did not respond yesterday to a written query about the steps her office took at the time.

On June 14, three weeks after the boy was first brought to court, Judge Nicholas S. Nunzio dismissed the case "for social reasons," without objection from prosecutors.