For a few early morning hours on Sunday, first responders to the Pulse nightclub in Orlando, Florida, were met with a scene that bore little difference from urban battlefields in Afghanistan and Iraq.

An assailant with a military-style assault weapon sprayed hostages and their would-be rescuers with bullets. Even after police blasted their way into the building, flushing alleged killer Omar Mateen out into the line of fire, there was no guarantee that there was no other shooter hiding inside.

"It's quite reminiscent of situations we've gotten into on the battlefield," says Dr. Brian Eastridge, trauma medical director at University Hospital in San Antonio, a colonel in the U.S. Army Reserve and one of the developers of the military trauma system. "When you get right down to it, the scene is very similar, particularly when you have an active shooter."

The multitude of factors that come into play when responding to a mass-casualty event are almost incalculable, changing with every scenario. But the challenges for first responders are the same: Stay safe and don't become another casualty; evacuate innocents as quickly as possible to get them out of the line of fire; eliminate the threat; and get victims the help they need.

"All of our big communities have mass-casualty and disaster-response plans," Eastridge says. "In spite of that, we all feel relatively unprepared. We can't be prepared for every eventuality."

Many of the principles used to help victims in mass-casualty events were learned in combat, whether in Vietnam or Iraq, experts say. Today, however, mass-casualty events are occurring closer to home so commonly – in places like Boston, London, Madrid, Orlando, and San Bernardino, California – that lessons are being learned there, too.

In the Boston area, emergency medical personnel and trauma teams have hosted physicians and disaster response experts from Israel, London, Madrid and Mumbai, India. They've offered insights from terror attacks that have ripped at the hearts of their cities.

"We've made significant changes based on those lessons," says Dr. Paul Biddinger, medical director for emergency preparedness at Massachusetts General Hospital.

Mass Shooting at Orlando Nightclub View All 31 Images

Dr. Ronald Stewart, chairman of the American College of Surgeons Committee on Trauma, says critical to preparedness is cities having designated trauma systems – made up of a system of hospitals capable of providing a range of trauma services. "That doesn't exist everywhere in the country," Stewart says.

And the Orlando massacre illustrates that no city is safe from catastrophic events, Biddinger says. "In Orlando at 2 a.m., nobody is thinking of casualties at this scale," he says, "but every hospital has to think how rapidly they can make room for incoming patients in the emergency department and make surgical capacity available."

The first priority for first responders is to evacuate anyone who can move under their own power and then quickly provide lifesaving aid to as many people as possible. As more rescuers arrive, they begin triaging patients who need hospital care, using a color-coded system of tags. For example, those in greatest need are tagged red; those in the least, green.

“It’s the ultimate challenge for prehospital personnel to enter into a scene like this, and quickly and effectively sort out those who are in imminent danger of death and those more likely to survive,” says Dr. Stephen Hargarten, director of the Injury Research Center at the Medical College of Wisconsin.

One of the most effective tools for saving lives is a tourniquet that can stop bleeding long enough for a trauma victim to get to surgery. Wounds to the torso are more challenging than wounds to the arms and legs, but pressure can slow bleeding in the armpit or groin long enough to get a patient to the operating room.

"The big rock is torso hemorrhage," Eastridge says. "Right now, we don't have a tool to manage that. The best thing they can do is get the patient to a place where they can get surgical control of the wound as quickly as possible."

Assault weapons create especially devastating wounds, experts say, because they fire a projectile at such high velocity that even a smaller bullet creates a massive wound. "Even though the bullet is less than a quarter of an inch wide, it makes a temporary blast cavity 4 to 5 inches across, and all the tissue in that area is in danger of being injured," Eastridge says.

It's like dropping a pebble in a pond, with much higher energy. The ripples are enough to cause incredible damage.