Dozens of surgeries were performed to save shooting victims after a gunman opened fire on a crowd attending a music festival.

Hospitals train for events in which there are a large number of casualties.

However, the number of people injured in the mass shooting in Las Vegas on Sunday night had the potential to be overwhelming for any medical center.

At least 59 people were killed. Hundreds were transported to hospitals after a gunman opened fire from a hotel window on a large crowd attending a music festival.

Officials said at a press conference that 527 people were injured in the attack, many with gunshot wounds that needed to be treated at hospitals.

Dr. Matthew Bank, the trauma medical director and chief of acute care surgery at North Shore University Hospital in New York, said even the best-trained hospital staff in the world would have difficulty caring for more than 100 seriously wounded patients in such a short period of time.

“There’s no trauma center that trains for 100 gunshot wounds in that time frame. That level would be incredible,” he said.

More than 100 patients were transferred to the only level-one trauma center at University Medical Center (UMC) of Southern Nevada.

Another 214 patients were treated at Sunrise Hospital and Medical Center. More than 120 of the Sunrise patients had gunshot wounds.

Officials released a statement on Monday that they had stopped all nonemergency care at Sunrise and had performed at least 30 surgeries in the immediate aftermath of the shooting.

“Our trauma center physicians and hospital staff have done an amazing job. So far, we have performed approximately 30 surgeries,” said Todd P. Sklamberg, CEO of Sunrise Hospital and Medical Center, in a statement on Monday.

“This has been an unprecedented response to an unprecedented tragedy. Our trauma team and all supporting nursing units, critical care areas, and ancillary services are all at work this morning in the aftermath of this tragedy — and most stayed throughout the night — to help the victims and to assist their loved ones,” he said.

Another 61 patients were treated at the three hospitals of Dignity Health–St. Rose Dominican, according to their representatives.

Mass shootings and other mass casualty events are routine enough that hospitals train for them, with level-one trauma centers training twice a year.

Bank said once a mass casualty event is declared, most hospitals have a protocol to clear operating rooms and reach out to staff so that there are more people to treat patients. Some staff who are scheduled to leave will stay to assist. Others will be paged.

Bank said a mass casualty event is defined as an event where there aren’t enough doctors and nurses for every patient. As a result, staff will start to perform a type of triage called “secondary triage.”

At that stage, doctors, nurses, and other staff have a goal to care for the most number of people possible.

This means some staff may have to make tough decisions about patients with little chance of survival. Bank said if a patient has a “2 or 3 percent” chance of surviving, they may not get immediate care.

“The one who is least likely to survive, [staff] may not really help because they’re trying to help the most number of people,” Bank said.

Recent mass shootings, including those at Pulse nightclub in Orlando, Florida, the movie theater in Aurora, Colorado, and Sandy Hook Elementary School in Newtown, Connecticut, have led medical officials to change how they prepare for mass casualty events.

UMC staff had even recently met with staff based in Orlando, who had treated patients after the Pulse nightclub shooting, according to public broadcasting station WMFE.

In 2013, the American College of Surgeons brought together a group of medical and law enforcement experts in Hartford, Connecticut, to come up with a plan to lower the death rate during mass shootings.

The group found that stopping bleeding after a gunshot injury was key to increasing the chance of a person’s survival. They’ve encouraged not just law enforcement, but also bystanders, to learn how to stop hemorrhaging.

“Military experience has shown that the number one cause of preventable death in victims of penetrating trauma is hemorrhage,” the authors wrote.

They also found that EMS responders should be trained to provide care in an active shooter scenario and that all hospitals — even those that aren’t level-one trauma centers — be trained for mass casualty events.

“To be prepared, all hospitals should routinely practice the enactment of disaster plans. Hospitals that are in proximity to places where large groups of people gather, such as shopping malls, schools, sports arenas, and movie theaters, should practice community scenarios to rehearse the rapid deployment of resources,” the authors wrote. “Drills should test the emergency department and hospital-wide activation.”

After the shooting at a movie theater in Aurora, Dr. Comilla Sasson, an attending physician at the University of Colorado Hospital,wrote in a post that to keep patients alive, they had to switch between resuscitating them and performing procedures that could save their life.

“We were running a chess game — coordinated chaos as we rotated the nine most critically injured patients in and out of resuscitation so we could place them on ventilators or put tubes in their chests to drain their lungs of blood,” Sasson wrote shortly after the shooting.

She continued that they saw patients with bullet wounds to their head, chest, abdomen, and extremities.

“Bullet wounds are tricky. A slug into the shoulder can wreak havoc in the abdomen,” she wrote. “It was crucial for us to monitor vital signs to make sure nobody was crashing.”

Of the 23 taken to the hospital, 22 survived.

Aside from the devastation emotionally and physically, shooting injuries also take a toll financially.

A study released today found that emergency room and hospital visits for injuries related to firearms cost approximately $2.8 billion every year.