A 17-year-old Alexandria youth was sentenced yesterday to five years in prison for a gang-related stabbing after prosecutors asked the judge to make a strong statement against youth violence by imposing a much longer sentence than state guidelines suggest.

Jimmy Hernandez, who was convicted of involuntary manslaughter in the July 3 death of Romulo Eric Ardila, 16, stood impassively as Alexandria Circuit Court Judge Donald M. Haddock overrode state recommendations that call for no more than six months in jail.

But members of his family burst into sobs, and deputies cleared the courtroom when his mother, Gladys Yanes, slumped to the floor in tears. Outside the courtroom, Assistant Public Defender Alex Rueda stood against a wall and wept while other attorneys tried vainly to comfort her.

"The judge struck a good balancing act," said Assistant Commonwealth's Attorney Thomas K. Cullen, who had asked for the maximum sentence of 10 years in prison. "He sent a message that if you do things like this in this city, you can expect a lot of punishment."

The stabbing occurred just outside George Washington Middle School as hundreds of students were leaving summer session. As two youth gangs brawled, Hernandez, then 16, pulled out a borrowed knife and plunged it into Ardila's chest.

The incident shocked city leaders, who later stepped up anti-gang efforts, and also served as the first major test of Virginia's new, tougher juvenile justice law, which treats young offenders more like adults. Under the new law, all of Hernandez's hearings were public, and his homicide case automatically was transferred to adult court.

Yesterday, defense lawyers portrayed Hernandez as a still-promising youth with a history of volunteer work for churches and other organizations, and they urged Haddock to release him to the community quickly.

"The prosecutor is asking you to make him a political pawn and telling you you need to make an example of him," Rueda said. "I have no doubt he's made some bad choices . . . but basically, he is a pretty good kid."

But Cullen said the defense characterization was too generous. Hernandez had been charged in Fairfax County as a juvenile with malicious wounding in another incident and had been suspended from Alexandria schools for weapon violations and fighting, he said.

Hernandez acknowledged during the trial that he had been a member of Latin Homies, an Arlandria-based gang, and that he and friends fought outside the school with Los Bravos, a gang that had members in west Alexandria and Fairfax County.

But Hernandez said Ardila's killing was unintentional. He said he was swinging the knife in self-defense as he was being kicked and struck by several Los Bravos members. The jury rejected murder charges before finding him guilty of involuntary manslaughter.

The state sentencing guidelines, based on past judicial decisions in similar cases, called for zero to six months in jail, but Cullen told the judge that such a sentence would signal to gangs that violence is tolerated in Alexandria.

"We have got to go on record as saying that gang violence is not permitted in Alexandria and will be punished to the full extent of the law," Cullen said.

Hernandez spoke softly before the judge passed sentence. "I'm really sorry to both the families," he said. "Unfortunately, Romulo died, my family's in pain, and I've wasted your honor's time. The only thing I can say is I'm sorry."

Haddock added five years of suspended prison time to the sentence. He issued his decision without comment.

Defense lawyers and prosecutors in Alexandria said the case probably would have had a similar outcome under the old juvenile law, because prosecutors regularly sought to transfer homicide defendants to adult court.

But Patricia L. West, Virginia's secretary of public safety, said the case illustrated the value of the new law.

"These types of gang-related cases are one of the very reasons the new law was enacted," West said. "Prosecutors could use the adult courts in the past, but they had to jump through so many hoops. This law has taken out a lot of pitfalls in seeing that justice is done." CAPTION: Jimmy Hernandez, 17, is escorted from Alexandria Circuit Court after his sentencing as his mother, Gladys Yanes, leans on the spectator railing and cries.