Sixteen-year-old Anthony Talbert testified in Alexandria Circuit Court yesterday that he fatally stabbed a 16-year-old schoolmate last August "because he was trying to do me harm."

Talbert told the 12-member jury that is hearing his trial on first-degree murder charges that for months before the fatal encounter he had been fearful that the dead student, Terrance (Martin) Penick, and one of his friends were "after me. They were trying to hurt me."

Talbert is accused of killing Penick Aug. 19 as he played dice with friends on Belvoir Street, just north of the Capital Beltway.

The defendant was 15 years old when the slaying occurred. He was ordered to stand trial as an adult in circuit court in November, after prosecutors successfully argued that his crime was so serious it could not be considered properly in juvenile court. The severest sentence he could have faced as a juvenile would have allowed him to be freed on his 21st birthday; if convicted as an adult, he can be sentenced to life in prison under Virginia law.

Talbert, a lean, brown-eyed eighth-grade student, told a full courtroom yesterday that he was walking to his girlfriend's home about 10:15 p.m. when Penick, who was playing a game of dice, stopped him and struck him in the face with a bottle. After he was struck, Talbert said, he pulled out a "hunting knife" from under his clothing and thrust it into Penick's lower back.

Several others, including Aretha Carrington, 16, testified they saw Penick pull a bottle from inside his coat, but only after he was stabbed.

Four teen-age witnesses said they saw Talbert stab Penick once in the back, and then, after he collapsed, kick him in the head.

Talbert has pleaded not guilty by reason of self defense and his lawyer, Stefan C. Long, argued that the stabbing "was justified" because "Penick had followed Talbert with knives, guns . . . " before this incident occurred.

Talbert's mother, Catherine Turner, testified that her son was so upset about the "harassment" from Penick that he had nightmares.

Shirley Penick told a reporter that her son Terrance was friends with Talbert for years and that the two often rode the school bus to Hammond Junior High School together.

Prosecuting attorneys Constance Frogale and David Dunlap rested their defense yesterday and said they expected the trial to conclude today.