Standing at an ATM in the first-floor atrium of the building where she works at the Washington Navy Yard, Patricia Ward was startled by a rapid succession of sharp noises that seemed to come from overhead.

Bam, bam, bam . . .

It was about 8:15 a.m. Monday in Building 197, a brick edifice that houses employees of the Naval Sea Systems Command.

“Was that a gunshot?” one of Ward’s companions wondered aloud.

They were on their way to have breakfast in the cafeteria nearby.

More loud cracks came almost instantly.

“We knew it then,” Ward said. “We just started running.”

So began a morning of tragedy and terror: a mass shooting that killed a dozen victims and injured eight others at the historic facility. Authorities said a 34-year-old Texas man apparently armed with high-powered guns opened fire, leaving a trail of bodies before he died, too, either from police bullets or his own hand.

His motive remains a mystery, and the precise sequence of events has yet to become clear. But for those who survived, who saw or heard what happened from narrow vantage points — crouched under a desk, standing flat against a wall, prostrate on the floor beneath a table — the memory is indelible.

A crisp September morning, Indian summer:

At 8 a.m., reveille crackled over loudspeakers at the Navy Yard as two sailors hoisted an American flag up a pole, marking the official start of the workweek. This being a military installation, many on the grounds, on the north bank of the Anacostia River, had already been busy for a while.

Tim Birkenbuel, a Navy contractor, was in his second-floor office when he heard what sounded “like a table falling on concrete.”

He heard the same sound again, and again — what turned out to be several gunshots in rapid succession. Some of his co-workers ran to the glass panels that surround the building’s atrium to see what was going on. Birkenbuel then barricaded them in the office for safety. And they waited.

Mark Vandroff, a retired Navy captain, had arrived by Metro from his home in Bethesda at 5:50 a.m. He had already worked out in the Navy Yard’s gym, showered and read through his e-mails. He was on the third floor, preparing for a meeting about the planned purchase of Arleigh Burke-class guided-missile destroyers.

A floor above him, Anthony Salemi, a logistics expert, was settling in at his desk. Down the hall, a dozen top civilian officials of the Navy’s Senior Executive Service were scheduled to soon meet for a briefing on billions of dollars’ worth of purchases.

Then came the sound. A conference table falling, Salemi thought.

“We’re always setting up for seminars and things like that,” he said. “I figured the leg had collapsed and one had fallen.”

But: “I heard someone yell, ‘Call 911!’ And I knew it was a shooting.”

He headed toward a staircase. Then, like Patricia Ward, Salemi heard a second series of sharp cracks — bang, bang, bang — and he broke into a sprint.

Vandroff had heard the initial noise, too, and like the others, he wondered what it was.

“The first sound that I heard, that I now think was gunfire . . . was a loud sound shortly after 8,” Vandroff recalled. “It sounded unusual, and we all looked at each other around the table, like, ‘What the heck was that?’ And then, the second sound — that was definitely gunfire. That was the unmistakable sound of gunfire. And it was very, very loud. . . .

“After that, people started screaming: ‘Close the doors! Close the doors!’ ”

Vandroff and eight others in the third-floor conference room stood up. Someone shut the door, but it didn’t have a lock. They decided to barricade themselves in. They flipped the conference table on its side. They wedged it under the door handle and packed chairs behind it. Then they got down on the floor.

Another burst of gunfire sounded, this one closer. Vandroff said he buried his head, then looked up when the sound stopped. There were two bullet holes near the top of a wall, as the gunfire continued.

“At different points, you couldn’t really tell where it was coming from,” he said. “The shot that when we looked up and saw the bullet holes in the wall was definitely close.”

Rick Mason, a program management analyst, told the Associated Press that a gunman was shooting from a fourth-floor overlook in the hallway outside his office. He said the shooter aimed at people in the first-floor cafeteria.

Navy Cmdr. Tim Jirus said that as he was leaving the building, he saw a co-worker who had been shot getting into a police car, and he heard more shots from inside his workplace.

Jirus went to an alley where he thought he would be safe and spoke briefly with a man there about what was going on. Jirus said he heard two gunshots, loudly echoing off the building. He spun toward the sound. When he turned back, the man he had been talking with was lying on the ground, shot in the head.

Uncertain where the shooter was, Jirus ran.

“I was just lucky,” he said. “The other person was shorter than me. There were two shots. He got that guy. He didn’t get me. . . . The randomness of it — standing right next to me, one person gets shot.”

David Stevens, a Navy contractor, was on the phone when he heard an initial volley of gunfire and people shouting that a shooter was on the fourth floor. He said he ran to the edge of the atrium and glanced up. Then he heard a “second deluge” of shots. The fire alarm sounded.

The first call to D.C. police came about 8:15 a.m., and Chief of Police Cathy L. Lanier said officers arrived at the Navy Yard “within literally two to three minutes.”

“Internal security had already . . . identified and engaged the suspect,” Lanier said — meaning they were trading shots with him. “We already had victims down at that point,” she said. “Within seven minutes, we had active-shooter teams inside the building, moving through the building.”

Quickly, District police were joined by U.S. Marshals, U.S. Capitol Police and U.S. Park Police, who entered the building and, talking on one radio frequency, began moving floor to floor, helping victims and securing rooms.

A Park Police helicopter airlifted an injured D.C. police officer from atop the building, while a helicopter from another agency circled to search for possible other suspects. The FBI arrived a bit later.

At 8:28 a.m., an e-mail went out to Navy Yard workers: “ALL HANDS on WNY Shelter in place.” Twenty minutes later, another e-mail: “All Commands on WNY report accountability of your personnel.”

Then, at 9:15 a.m.: “Shelter in Place and or a Lockdown is security posture taken to protect personnel. Stay indoors, if outside, get within a building. Stay away from windows or open buildings, Remain indoors until the ‘all clear’ is given. Secure doors and windows.” And a half-hour after that: “ALL PERSONNEL ON WASHINGTON NAVY YARD CONTINUE SHELTER IN PLACE. REMAIN CLEAR OF ALL WINDOWS.”

Lanier said officers eventually encountered the gunman.

“There was a gunfight with the suspect,” she said. And the suspect “was eventually deceased.”