District school officials, reacting to the stabbing of a student, increased security yesterday at Kramer Junior High School and announced that portable metal detectors will be installed on the premises.

The decision, a day after a 13-year-old youth was stabbed in the back, came amid complaints from teachers who said the incident reflected chronic safety problems for students and instructors at Kramer.

William H. Brown, the city's interim school superintendent, announced the measures in a brief statement late yesterday afternoon. A spokeswoman said that the metal detectors, which will be placed only at Kramer, will be installed as soon as it can be arranged.

A crisis intervention team, including counselors, psychiatrists and social workers, spoke to Kramer students at an assembly yesterday morning, then spent the day at the school. The team was joined by school officials and police officers who were still investigating Wednesday's stabbing in the cafeteria.

The victim, Joseph Harris, was stabbed in the back by a 15-year-old girl over what police and witnesses said was harassment by the youth. Harris was in critical condition at Children's Hospital yesterday, being treated for a collapsed lung caused by the stabbing.

Kurt Newman, his surgeon, said the wound in the middle of Joseph's back indicated that the long knife had been twisted, producing what he called a "lateral kind of cutting as well." The stabbing, Newman said, was nearly fatal.

"You can imagine there's a lot of vital organs there, and he's kind of a lucky guy," Newman said. "Somehow, it seemed to miss these and it just penetrated into the chest, producing a collapsed lung, which was the major injury."

Two teachers at Kramer, both of whom asked that they not be identified, said the knife used to stab Harris had been in a school locker for some time. Citing information received from students yesterday, one veteran teacher said that Joseph's harassment of the 15-year-old earlier in the day led to the confrontation.

The girl, who has been charged with assault with intent to kill, at one point asked a friend to get the knife from the locker, the teacher said. The friend, who has not been charged, got the knife and later sat next to the 15-year-old in the cafeteria, the teacher said.

Several students said Wednesday that Joseph was "messing" with the girl just before the stabbing. The teacher, again citing the account of students and others at the school, said the taunting by Joseph included patting the girl on her rear end and shoving her chair.

At one point, the girl turned to her friend and asked for the knife, the teacher said. Joseph, several students said Wednesday, was walking away when the girl approached him from behind and plunged the knife into the middle of his back. The girl then returned to her chair, wiped the handle of the knife with a napkin, set it down on the table and walked away, witnesses said.

Installing metal detectors throughout the D.C. school system has been discussed before but never seriously debated. The two Kramer teachers, who recalled several recent assaults on school grounds, said faculty members have been asking for metal detectors without result.

"The horse is gone; the river is over the bridge," said one of the teachers, responding to the school system's announcement. "They are just fortunate the kid did not die."