Even though one is 14 years old and the other 15, two Montgomery County high school students charged with sexually assaulting and robbing a woman are considered adults by Maryland's criminal justice system. To avoid being prosecuted as adults, they would have to persuade a judge to move their cases to juvenile court -- almost certainly over objections by prosecutors.

Ryan H. Baird, 14, and Andrew G. Klepper, 15, are charged with first-degree sex offense, armed robbery and conspiracy counts. A third defendant, Young Jiun Song, who has been charged with first-degree assault, robbery and other crimes in the case, is 19 years old.

Under Maryland law, defendants who are 14 to 17 years old and accused of certain serious crimes -- including first-degree sex offense -- must be charged as adults in Circuit Court, not in the juvenile system, said Harry J. Trainor, an Upper Marlboro defense attorney. Those serious crimes include any offense that, if prosecuted in an adult court, could be punishable by death or life in prison. The charge of first-degree sex offense carries a possible life term.

When a juvenile is initially charged in Circuit Court, the defense has the burden of persuading a judge if it wants the case transferred to juvenile court. If prosecuted in juvenile court and found responsible for a crime, a youth can be confined to a juvenile detention center, but only until age 21.

Traditionally, the legal system treats defendants under age 18 differently than it does adults, on the theory that society should seek to rehabilitate young people, not punish them. Their legal proceedings almost always are held in secret to spare them from being stigmatized. But for certain heinous crimes, adolescent defendants face the same penalties as adults.

In deciding whether to transfer a case to juvenile court, Circuit Court judges in Maryland have broad discretion, legal experts said.

Judges weigh five factors in deciding whether to order such a transfer: the age of the defendant, the mental and physical condition of the defendant, the defendant's amenability to treatment in an institution geared toward delinquents, the nature of the alleged crime and public safety.

In Virginia, the process works differently. Defendants as young as 14 can eventually be charged as adults, but their cases begin in juvenile court. In serious cases, such as first-degree murder, a prosecutor can ask a judge to transfer the juvenile to adult court. For instance, authorities have said they will take that step in the case of John Lee Malvo, 17, the younger of the two Washington area sniper suspects.

In murder cases, if a prosecutor presents strong evidence that the defendant committed the crime, the judge usually will transfer the case to adult court, said James G. Connell III, a Fairfax County defense attorney. If the youth is charged with a less-serious offense, such as robbery, a defense attorney can argue before a judge that the youth could be rehabilitated in the juvenile justice system, Connell said.

In the District, the U.S. attorney's office can charge a juvenile who is 16 or 17 as an adult for certain serious crimes, such a first-degree murder, said Peter Lavallee, a spokesman for the Office of Corporation Counsel, which prosecutes juvenile court cases. The youth's attorney does not get a chance to ask a judge to transfer the case to juvenile court.