Germanie Alexander and BreAnna Holmes were on their way to work on Thursday, July 2 when they were stopped by police and told to evacuate the scene because of a report of possible gunshots fired inside the Washington Navy Yard. (McKenna Ewen and Whitney Leaming/The Washington Post)

On another dreary, overcast morning, as people trudged into Building 197 in the Washington Navy Yard on Thursday, the message went out again: “Active shooter in building.”

It had been 654 days since those people had heard the same words.

“I thought: ‘Oh, no. Not again,’ ” said Betty Davis, a contract janitor at the military base. “I prayed. That’s all you can do.”

Less than two years after Aaron Alexis killed 12 people and wounded three others in Building 197, there was horror that it could be happening again.

The panic began at 7:29 a.m., when a woman inside the building reported hearing gunshots. Within moments, officers from nine federal and local agencies flooded the Navy Yard and the adjoining neighborhood, with lines of patrol cars, lights flashing, filling M Street SE for blocks. Officers with bulletproof vests and assault rifles headed toward the building. Streets were closed off, and police helicopters and a small plane circled above.

Some workers fled the building as others hunkered down in locked offices or ducked behind furniture. Over about three hours, police methodically searched Building 197, moving room by room as they monitored security cameras trained on the interior. They found no gunman, no evidence that shots had been fired; nothing but shaken workers.

People who live near the Navy Yard compound in Southeast Washington said they heard loud booms about the time the gunshots were reported and wondered if they might be thunder. Police Chief Cathy L. Lanier said police don’t know what the sounds were.

Were the booms heard at another time and place, the reaction probably would have been more muted. Even at other hyper-sensitive sites in Washington — the Pentagon, the CIA or the NSA — a single call about a sound that may have been gunshots probably would be less provocative.

But the indelible horror of being trapped in Building 197 with a mad gunman two years ago, and all the self-examination and training of law officers since then, had their effect Thursday.

In the months since the building reopened in February, some workers’ trepidation, from the memory of cowering under their desks on the most improbable day of their lives, had diminished. But that fear was renewed in an instant by the “active shooter” text message sent through the network. Once again, those who could fled the building, and others huddled inside in places that seemed safe.

Jennifer Bennett, 58, who was seriously wounded in the Sept. 16, 2013, shooting, said she was in her office when she heard what she thought were gunshots.

“I just heard two loud boom-booms,” Bennett said. “They sounded like gunshots. However, there’s no evidence that the sounds came from a gun.”

An announcement was made to shelter in place, and Bennett and another person started working through a phone tree, making sure everyone in their group was safe.

Tonya Dorsey, who does janitorial work, was preparing to start her shift when others sounded the alarm. “We just heard, ‘Get out of the building!’ ” said Dorsey, 44. “The guards were telling us to go, go, go.”

Guards escorted her to a building next door, where she sat in a conference room and waited.

“My stomach was nervous and jittery,” Dorsey said. She was allowed to leave around noon. “I’m so happy to go home. I’m so relieved.”

Michael McCord, a systems manager at Naval Sea Systems Command, called his wife as announcements blared in the background, telling people to “go to a secure area.” Two years ago, McCord narrowly missed an encounter with Alexis, whose rampage ended when he was fatally shot by police. As McCord rushed to get out of the building that day, someone told him, “Don’t go that way, the shooter’s down in the foyer.”

On Thursday, he joined scores of others in a conference room until they were told there was no gunman.

“He feels safe, but he’s distraught and upset. This is just like — ‘Wow, this is happening again,’ ” said his wife, Nancy McCord.

With the employees on lockdown, police streamed in. Lanier said officer Scott Williams, who was shot in each leg by Alexis and was pulled to safety by colleagues, was one of the first to enter Building 197 on Thursday.

Jonathan Usher had just clocked in for work in the building’s cafeteria and slipped on his black apron when he heard an alert. A security guard with a shotgun waved him over to evacuate, and he quickly walked to a building behind the nearby Harris Teeter supermarket.

The whispers began among the dozen people with him: “How did another person come up on the base with a gun?”

Usher, a contract worker, said he and his co-workers spent the next several hours guessing what could have happened, and when he finally left around 1 p.m., he still wasn’t sure.

In the absence of concrete information, rumors filled the void. At one point a man passed on that a military officer had said there were two gunmen and that someone had been shot.

Lt. Cmdr. Scott Williams, 39, chief engineer of the guided-missile destroyer program, said he was talking to colleagues in a hallway when he heard shouts: “Get down! Get out of the cafeteria!”

“People ran for the exits,” he said. He and others dove into an office, staying there until police officers came and escorted them out.

He was in Building 197 during the mass shooting two years ago.

“You say lightning never strikes twice. Here we are again. It’s surreal,” he said. “Brings back a lot of painful memories. It’s kind of hard.”

He said police seemed very well coordinated.

“It’s obvious they learned from last time,” he said. “I thought the response was great. We were out of the building within half an hour of when we took shelter. They got us out of there, and they got us out of there safe.”

He said that when he joined the military, “the assumption was once you were in an installation, you were safe. No more.”

To get into the facility, he said, he has to swipe his picture ID card, which is then checked by an armed security guard. “It seems they’re doing everything they can short of making it impossible for anyone to go to work,” he said.

The interior of Building 197 was remodeled after the 2013 shooting, and a minor change in procedure influenced the spread of the alarm Thursday. Before the shooting two years ago, people entering the building were required to secure their cellphones in lobby lockboxes. When the building reopened, however, people were allowed to retain their phones as they worked.

“I called a couple of people,” said a contractor who was in Building 197 during the Alexis shooting and was about to enter the Navy Yard when the commotion started Thursday. “I talked with [a colleague] who made it out. He told me as soon as [the ‘active shooter’ alert was transmitted,] he evacuated and made it out of the building.”

The contractor, a former Marine, said cosmetic changes were made to the building before it reopened, in part to ease the trauma for people who had survived the attacks and would return to work there. Other than allowing personal cellphones, however, he said there were not apparent enhancements to security.

“The first thing that came to my mind was, why don’t they invest in metal detectors as part of the building upgrade?” he said.

Some were unfazed, including one man who was in line to get into the Navy Yard as others left.

“I’m here to earn my salary,” said the man, who spoke on the condition of anonymity because federal workers were told not to speak to reporters. “I’m here to do my job. I want to be here serving the American taxpayers. I don’t think we should be fearful. We should be cautious.”

Arelis Hernandez, Peter Hermann, J. Freedom du Lac, Abigail Hauslohner, Joe Heim, Aaron C. Davis, Clarence Williams, Matt Zapotosky and Julie Zauzmer contributed to this report.