Temple University Hospital doctors were waiting at the ambulance bay doors at 4:40 p.m. Wednesday when the first squad car pulled up and a Philadelphia police officer burst out of the back door.

His arms outstretched, he ran toward the emergency staff, who grabbed him by the shoulders and tried to calm him. Then a second squad car showed up. Then a third.

Multiple shootings in a night, even shootings of police officers, are not unusual for Temple, which treats hundreds of victims of gun violence a year. Triaging panicked victims, reassuring terrified families and scooping the injured out of police cars are all part of a normal night shift for emergency physicians, nurses, and other hospital staff.

But on Wednesday night, as the trauma alerts rolled in, Temple doctors quickly realized that the shooting that brought three police officers to them was still active. Unfolding just blocks away, it sent the entire health campus into a lockdown even as the emergency department prepared for more victims.

» SPECIAL REPORT: How a routine drug raid unfolded into a hail of bullets, chaos, tense phone calls and miraculously little bloodshed

“It was pretty intense,” said Michael DeAngelis, the hospital’s vice chair of clinical affairs, who was one of two attending doctors in the ER that night. “But unfortunately, we’ve had multiple shooting victims present at one time before, we’ve had officer shootings before, and in that sense, we’re always prepared for these sorts of incidents. We had all the right people here last night.”

Physicians and nurses helped the wounded officers into trauma bays as they came in, checking to make sure they didn’t have additional injuries that weren’t immediately apparent.

Two were able to walk in on their own, DeAngelis said, and the third was supported by fellow officers. All suffered only soft-tissue injuries, but one had a chilling near miss: a graze wound to his scalp: “A matter of millimeters,” DeAngelis said, “and that officer doesn’t walk out of the hospital.”

Even as the gunman down the street continued to fire and the hospital hunkered down, the emergency department stayed open for walk-in patients, though ambulances were directed to nearby hospitals. Lars Ola Sjoholm, the hospital’s chief of trauma, fielded calls from surgeons, anesthesiologists, and blood bank technicians looking to help. Staff opened operating rooms, set up CT scanners, and moved patients from the ER to other units, to make room for more potential victims, Temple Hospital president and CEO Michael Young said.

»READ MORE: Temple is Philadelphia’s “de facto” public hospital.

“I was really impressed with the professionalism, the action, and the teamwork,” he said. “No one said, Oh, my unit’s full. They said, Oh, I’m glad to help.

Trauma surgeon Liz Dauer resolved, as always, to focus on the task before her.

“My job is to take care of patients and direct the care being given to them,” she said, “and leave all the other stuff to other people, because that’s what their jobs are. But everyone was at the ready in case we did get more patients.”

In the buildings around the hospital, patients, doctors, and staffers received text messages from the university’s alert system warning everyone to stay in place. The lockdown came just hours after the health system hosted an event with therapy dogs and a miniature horse to help patients through stressful hospital stays.

Then, just a few hours later: “Seek shelter. Secure doors. Be silent. Be still. Police are responding,” the university wrote on Twitter.

In the emergency room, patients ready for discharge had to wait in a space typically used for inpatient procedures until the hospital determined it was safe to start releasing them, with a nurse on hand monitoring the room. The hospital first went on lockdown shortly before 5 p.m., said Dwight McBee, the hospital’s chief experience officer, and security let people in and out on a case-by-case basis.

About 10 minutes later, hospital security opened two entrances and screened people wishing to leave or enter. They encouraged people who didn’t have to leave immediately to stay because of the volatility of the situation outside, said Wes Light, the hospital’s director of security and emergency preparedness.

Even if people wanted to leave, it was difficult to get out of the neighborhood, he said — SEPTA’s Broad Street Line stop at Erie Avenue was shut down and police had cordoned off many streets in the neighborhood.

Hospital staff handed out snacks, and bottles of water to patients and family members waiting inside. Small children nervous about the mass of police officers outside got candy: “Anything we can do to bring some measure of comfort,” McBee said.

“It’s extremely challenging when you lock down a hospital," he said. "You still have to be able to provide care urgently.”

One patient who needed care was a pregnant woman who showed up at the emergency department, surrounded by family, midway through the lockdown. Her water had broken and she was admitted immediately. McBee said: “We couldn’t turn her away and couldn’t tell her to go through the right entrance. We had to care for her.”

Just before 10 p.m., the lockdown lifted entirely; even though the situation down the street was still active, McBee said, police had assured the hospital it was stable enough to allow patients to leave.

For hours beforehand, researchers and university staff sheltered in their offices. From his window on the 11th floor, Larry Kaiser, president and CEO of Temple’s health system, could see a mass of police cars assembling on Broad Street.

Then came a flurry of texts and calls from friends and colleagues around the country, checking to see if he was OK. He was, he assured them: But with little information available about the shooting, others in the building were growing alarmed. In the Office of Institutional Advancement, on the other side of the building, with no view of the scene, a supervisor told him “her people were freaking out.”

“We’ve never had a situation where we had a lockdown here,” he said. “I had queries from all over the country, people saying, Are you OK? Are you OK? It certainly could have been much worse, and it was a great job the police did to prevent any collateral damage."

Meanwhile, in the emergency room, physicians had determined the officers they were treating had suffered no life-threatening injuries. Three other officers wounded in the shooting were taken to Albert Einstein Medical Center, and also suffered non-life-threatening injuries.

“It was scary for the officers, and scary for their families, but once they found out they were going to be OK, everyone was feeling a little bit better,” Dauer said. “They were obviously all shaken up by the incident.”

As the night wore on, and officers negotiated with the shooter down the block, Dauer and the other doctors in the emergency department continued to work their shifts.

Eight or nine more trauma patients, she said — entirely unrelated to the police shooting — came through the ER before she went home to sleep.