NEW ORLEANS — Each day, students entering Carter G. Woodson Middle School step through metal detectors while security officers patrol the grounds.

Yet none of the traditional ways of ensuring school safety could stop gunfire from erupting Tuesday as a 13-year-old and a 15-year-old traded shots in the crowded breezeway shortly before noon.

The younger boy got the gun from outside a chain-link fence and shot the 15-year-old, only to have the older youth grab the gun and shoot him in the back as he ran away, police Lt. Marlon Defillo said. The hospital identified 13-year-old as Darrell Johnson, and the police identified the 15-year-old as William Pennington.

Police said it wasn't clear what prompted the argument between the two boys but said detectives believed the dispute started several hours before the shooting.

A 13-year-old boy who allegedly passed the gun to Johnson is a former student at the school who had recently been expelled for fighting, police said.

The wounded boys, both eighth-graders, were in critical condition Wednesday. Johnson will be booked with attempted murder when he is released, Defillo said. The teen who allegedly slipped the .38-caliber revolver into the school was identified by police as Alfred Anderson. He faces felony charges.

"This horrifying event brings too close to home the widespread proliferation of gun violence and underscores our fighting belief that handguns are too easily available to children," Mayor Marc Morial said.

Several fights had been reported over the past few weeks at the 600-student school, which sits in a poor neighborhood next to a rundown housing project.

But school Superintendent Alfonse Davis denied that the shooting was linked to any previous violence. "There's no connection between this incident and any past incidents," he said.

Pandemonium broke out after the shooting, as hundreds of parents lined up to collect their children. Some yelled at police and security guards, angry that no one saw the gun before the gunfire.

Beronica Lewis hugged her daughter, Neshetta, 15, when she came out of the school, saying she didn't want to send the child back for classes. "They could come back here and shoot again," Lewis said.

Anderson was arrested without incident about five hours after the shooting at his home in a nearby housing project, Defillo said. He was booked on charges of illegally carrying a weapon and being a principal to attempted first-degree murder. He faced a detention hearing Wednesday.

Dozens of students were in the breezeway and hundreds were in a nearby cafeteria when the shots were fired. Teachers kept them inside classrooms while the two wounded boys were taken to Charity Hospital.

Pennington, shot in the chest, had a kidney and spleen removed during surgery. Hospital spokesman Jerry Romig said Wednesday that it was likely that both youths will recover fully.

Classes at the middle school were canceled until Monday, although the school will remain open for students who want to talk with counselors.

Two or three police officers will be assigned to the school when it reopens, in addition to the usual 10 assigned to the neighborhood.

In 1998, New Orleans was one of the first cities to sue gunmakers to recover the cost of gun violence and accidental shootings involving children. About 25 other municipalities have filed similar lawsuits. Some have been dismissed while courts have allowed others to continue.