PITTSBURGH — As gunfire shattered the prayerful morning stillness of the Tree of Life synagogue, Barry Werber was hiding in a darkened storage room. In front of him was Melvin Wax, a longtime member of the New Light Congregation whose body now lay on the floor. Then a man stepped through a swinging door into the room.

Mr. Werber saw that he was carrying a long gun.

“He walks in,” Mr. Werber said of the killer. “He steps over Mel’s body.”

The man seemed to look around for a brief moment, but couldn’t seem to see in the darkness. He walked back out.

Mr. Werber escaped with his life. But 11 others in the synagogue on Wilkins Avenue on Saturday morning did not. The massacre unfolded over about an hour in individual acts of endurance and courage — Mr. Werber holding his breath in the darkness, police officers who rushed in while the gunfire was still raging to confront the killer, congregants who put aside their terror to help one another.