When an Afghan commando turned on his American and Italian allies, Petty Officer 2nd Class Alejandro Salabarria, a hospital corpsman, leapt into action, treating his wounded comrades and killing their attacker, Marine Corps Times reports.

On Sept. 15, 2014, in Herat province, Afghanistan, Salabarria and his team members with 2nd Marine Raider Battalion were waiting for inbound CH-47 Chinooks to take them out on a pre-dawn mission when all hell broke loose.

One of the Afghan special operations commandos attached to their unit turned his M4 and M203 grenade launcher on his allies, launching a 40mm explosive round, followed by bursts of fire, into the closely grouped troops, sowing chaos and disorder among them.

Normally Salabarria was assigned to the main element, which would have put him directly in the kill zone, but this time his position was further back.

Related: UNSUNG HEROES: The Corpsman who sprinted into gunfire to save 5 Marines »

“I just happened to be at the right place at the right time,” Salabarria told Marine Corps Times, adding the initial burst of fire caught everyone off guard. “At first we were stunned; we weren’t outside the wire. … It took a couple seconds to realize what was going on.”

Unfortunately, it wasn’t a mistake.

Hearing screaming, followed by a muzzle flash, Salabarria began piecing together what was happening. Not wanting to risk a shot for fear of hitting the wrong person, he began assessing the situation, seeking out the wounded.

When he learned that the senior medic had been hit, Salabarria dashed 100 yards to the kill zone and began treating his fellow corpsman who was wounded.

Just then, he noticed the shooter closing in on him,

“He wasn’t running, he was walking real slow,” Salabarria said. “The dude’s shooting at me, at my patient.”

Reacting instantly, Salabarria threw himself between his patient and the attacker, while simultaneously raising his M4 and putting several rounds into the rogue commando. Once he confirmed the gunman was down, Salabarria returned to treating the injured.

Shortly after, a combat lifesaver-trained Marine arrived to help Salabarria treat the wounded, as the incoming CH-47s — now rerouted and tasked for casualty evacuation — made their way to the landing zone, which had to be cleared first.

Salabarria stayed with the injured, treating them on the flight until they arrived at the closest medical facility. Tragically, one of the Marines, Sgt. Charles Strong, succumbed to his wounds.

For his heroism under fire, Salabarria was awarded the Silver Star, the third highest medal for valor, on Feb. 5 aboard Marine Corps Base Lejeune, North Carolina.

“(This medal) is more for Capt. Shaw and Sgt. Strong than anything,” said Salabarria at the ceremony, referring to Stanford Shaw, one of the seven special operations Marines lost in a March 2015 helicopter crash. “It’s all for them.”