WASHINGTON (AP) — A former Army medic who received the nation’s highest military honor Monday for braving heavy gunfire to save lives in Afghanistan was rejected by the military the first time he tried to enlist.

“Boy that was a bad mistake. But they made up for it, right,” President Donald Trump said in a formal White House ceremony where 250 people gathered to laud former Staff Sgt. Ronald Shurer II for his heroic actions in 2008 in a remote part of Afghanistan.

“For more than six hours, Ron bravely faced down the enemy. Not a single American died in that brutal battle, thanks in great measure to Ron’s heroic actions.”

Shurer, a native of Fairbanks, Alaska, was a senior medical sergeant in the special forces on April 6, 2008 when his team encountered machine gun and sniper fire and rocket-propelled grenades from militants.

Shurer stabilized one soldier, then fought his way through a barrage of bullets and up a mountain to the lead members of the unit. There, he treated and stabilized four more soldiers. Shurer helped evacuate them, carrying and lowering the wounded down the steep mountainside, using his body to shield them from enemy fire and shrapnel. After he loaded the wounded in an evacuation helicopter, Shurer went back up the mountain to fight.

“Ron was not done yet. He charged back to the mountain — all the way up — and rejoined the fight,” Trump said. “For more than six hours, Ron bravely faced down the enemy. Not a single American died in that brutal battle, thanks in great measure to Ron’s heroic actions.”

First rejected by the military because of a medical condition, Shurer enlisted again a year after 9/11. He was accepted the second time around. He was promoted from sergeant to staff sergeant in late 2006 and served with the Combined Joint Special Operations Task Force in Afghanistan from late November 2007 to late May 2008. He was honorably discharged a year later.

He began his career with the Secret Service as a special agent assigned to a field office in Phoenix, Arizona, in September 2009. He was selected for the Secret Service’s counter assault team and assigned to the Special Operations Division in June 2014.

Shurer lives in Burke, Virginia, with his wife, Miranda, and sons Cameron, 10, and Tyler, 7.