Police officers raced to the school. Some students trembled as they crouched in corners trying to hide. A few staff members began to pray.

“We really thought we were not going home that night,” one teacher said. “It was probably the worst feeling I ever had in my life.”

Less than a week after the massacre at Sandy Hook Elementary School, in Newtown, Conn., a lockdown exercise on Tuesday morning at Public School 79 in East Harlem caused alarm, as not everyone understood there was to be a drill.

On Wednesday, Marge Feinberg, a spokeswoman for the New York City Education Department, said only, “We are looking into how this drill was conducted.” The school’s principal, Greer Phillips, declined to comment.