In the intense aftermath of the school shooting last week, Dr. Igor Nichiporenko pronounced a wounded teacher dead on arrival and massaged the bullet-shredded heart of a student, trying in vain to restart it. He and his colleagues also treated six other teenagers, some of whom were in the emergency room and others who were rolled off to operating theaters.

Then, about an hour after the victims began pouring into Broward Health North hospital, word came that another patient was about to arrive. With distraught relatives and journalists converging on the hospital in Deerfield Beach, Fla., the medical staff now faced the challenge of treating the man accused of causing all the carnage.

“Dealing with trauma patients, you’re always going to have to deal with the bad guys, too,” Dr. Nichiporenko said, recalling the myriad times when crime suspects and victims were in rooms next to one another. “You have to be professional and do your job.”

This was a tragedy of rare magnitude: 17 killed at a high school just miles down the road.

When President Trump visited wounded victims of the shooting at the hospital on Friday, he was not far from the room where the suspect in the attack, Nikolas Cruz, was treated two days earlier.

Occasionally, however, the very medical staff tending to victims of a mass shooting are called on to treat the suspect.

That happened in November 2009 in Fort Hood, Tex., after Maj. Nidal Hasan opened fire. He took aim at a 23-year-old Army medic, Specialist Francisco De la Serna, and missed. Specialist De la Serna, who stanched the bleeding of many of Major Hasan’s victims, also applied a dressing to the gunman’s chest wound after he exchanged fire with the police. Major Hasan, himself a doctor, was then transported to a hospital where his victims were being treated. “It was the right thing to do,” said Mr. De la Serna, who was later honored for his bravery and is now a medical student at the University of Kansas. “It was the opposite,” he added, “of what somebody of that mind-set would have done.”

Image

Nikolas CruzCreditBroward's Sheriff's Office

As of Monday, two survivors of the shooting last week at Marjory Stoneman Douglas High remained hospitalized in fair condition at Broward Health North, and two others remained in fair condition at Broward Health Medical Center in Fort Lauderdale, according to Jennifer Smith, a spokeswoman for the health system.

In all, 17 patients from the attack were treated at three of the system’s hospitals. The teacher and student pronounced dead after reaching Broward Health North were the only shooting victims who died in those hospitals. Others were pronounced dead at the scene.

The patients who arrived at Broward Health North had gunshot wounds mainly in their chests and abdomens, Dr. Nichiporenko said. They seemed pale and quiet as they were carried in, which can be an ominous sign of major bleeding.

“I think they were all in stress and emotionally shocked,” Dr. Nichiporenko said. “Nobody was screaming.”

They were “14-, 15-, 16- and 17-year-olds,” Dr. Nichiporenko said, though the level-two trauma center is not specifically designated for children under 16. “We’re all trained to take care of pediatric patients if we need to treat them and stabilize them,” he said.

When the call came about the suspect’s arrival, the hospital staff made arrangements to treat him. “They called in with a gunshot wound,” Dr. Nichiporenko said. “He stated that he was shot, so everybody thought he was injured.”

A team of four was assigned to treat Mr. Cruz in the emergency room — two nurses and two doctors, including Dr. Nichiporenko, the hospital’s trauma director, who trained as a trauma surgeon at St. Vincent’s Hospital and Medical Center in New York and hails from Moscow.

“We just picked people we know can stay cool,” Dr. Nichiporenko said. “We chose the ones who wouldn’t get emotional about it.” The hospital had already been locked down — its entrances, exits and trauma rooms were guarded by security staff.

Image

Broward Health North hospital, where two survivors of the school shooting remained hospitalized in fair condition on Monday.CreditAl Drago for The New York Times

Mr. Cruz was brought in a back entrance and treated in an isolated part of the emergency room, “where no families or relatives of the victims could have any access whatsoever,” Dr. Nichiporenko said. “We did it in a way that they wouldn’t even know the shooter was in the hospital.”

The hospital system had participated in the county’s first full activation drill for a mass shooting, complete with SWAT team response, five years ago, said Kelly Keys, the system’s manager of emergency preparedness. Last year, Broward Health North ran an active shooting simulation. And Broward Health Medical Center received victims of a mass shooting at Ft. Lauderdale-Hollywood International Airport in January 2017.

Mr. Cruz was brought into a critical care room, lying on a stretcher in his street clothes. “Is anything hurting you?” Dr. Nichiporenko said he asked. Mr. Cruz did not answer. He appeared “really flat, no expression,” the doctor said of Mr. Cruz, noting that he looked the same in a court appearance the next day, wearing a jail jumpsuit.

In keeping with hospital protocol, the maroon Junior Reserve Officers’ Training Corps polo shirt and pants Mr. Cruz was wearing were cut off so that any injuries could be located. Dr. Nichiporenko examined him from head to toe but found no gunshot wounds. His vital signs were stable. He stayed silent, not uttering a word when the doctor was with him and not answering any questions, the doctor said.

“I went back to treat the trauma patients,” Dr. Nichiporenko said, adding that he had turned over Mr. Cruz’s care to an emergency physician, who cleared him for release.

According to the ethics of their professions, doctors and nurses must treat patients according to need in emergencies, without regard to other factors. By law, hospitals in the United States must also stabilize and treat anyone arriving in an emergency department. Dr. Nichiporenko said that staff members were upset, but he did not hear anyone express the opinion, inside or outside the hospital, that Mr. Cruz should not have been treated. “He got good care,” he said.

Mr. Cruz was discharged within about 40 minutes, the doctor estimated. Still wearing a hospital gown, he was rolled in a wheelchair to a police car. By then, word had spread in the hospital that the gunman was there, but Dr. Nichiporenko said staff members remained focused on treating the wounded teenagers. “We still had a lot of work to do,” he said.

Two days later, the doctor escorted the president and Melania Trump, the first lady, through the hospital for private meetings with two remaining patients and their families. The president emerged to speak briefly with the news media, flanked by the doctor and Mrs. Trump. “Fantastic hospital, and they have done an incredible job,” Mr. Trump said, turning to Dr. Nichiporenko and shaking his hand. “I want to congratulate you.”

Dr. Nichiporenko said he observed only one person — a parent of one of the wounded teenagers — pressing Mr. Trump to make sure this kind of tragedy never happened again. “We’re going to work on it,” Dr. Nichiporenko recalled Mr. Trump as saying. He did not elaborate, the doctor said.

A version of this article appears in print on , on Page A12 of the New York edition with the headline: Treating the Victims, and the Teenager Accused of Gunning Them Down. Order Reprints | Today’s Paper | Subscribe