WASHINGTON — It was clear almost as soon as the May 1969 assault began that the orders — to attack Nui Yon Hill, near the city of Tam Kỳ, Vietnam — were flawed. The North Vietnamese and the Vietcong had the American position surrounded on three sides.

Into their gunfire stepped — or, rather, ran — James C. McCloughan, a 23-year-old private first class Army medic who had been drafted just a year earlier from his hometown, South Haven, Mich., to join the fighting.

Zigzagging through enemy bullets again and again, Mr. McCloughan is credited with saving the lives of 10 members of his company over the next two days of battle. When shrapnel from a rocket-propelled grenade and later small-arms fire tore into his head and arm, he refused to follow a superior’s urging to evacuate for medical help and carried on.

The Run-Up

The podcast that makes sense of the most delirious stretch of the 2016 campaign.

“He knew me enough to know that I wasn’t going,” Mr. McCloughan told The Associated Press recently.

On Monday, 48 years after the battle, Mr. McCloughan, 71, stood in the East Room of the White House to be recognized for that persistence with the country’s highest military decoration, the Medal of Honor. Ten men from his company, including five whose lives he helped save, looked on.

President Trump, in his first time awarding the decoration, said Mr. McCloughan had made it through “hell on earth” and earned a “place among legends.”

“He would not yield. He would not rest. He would not stop. And he would not flinch in the face of sure death and definite danger,” Mr. Trump said. “Though he was thousands of miles from home, it was as if the strength and pride of our whole nation was beating inside Jim’s heart.”

For Mr. Trump, the sober ceremony turned out to be a respite from the latest episode in the insistent chaos that has consumed his administration in recent weeks. This time, it was the sacking of Anthony Scaramucci from his position as communications director, just days after he had been brought on, that set the White House abuzz as 250 guests, including top military officials and members of Mr. Trump’s cabinet, mingled before the ceremony.

For Mr. McCloughan, standing nearby as Mr. Trump recounted his story, the award had been long delayed and not exactly expected. After he returned from Vietnam in 1970, he accepted a deferred job offer from South Haven High School and more or less picked up civilian life where he left off. For four decades, he taught sociology and psychology and coached football, baseball and wrestling, before retiring in 2008.

Interactive Feature | Get the Morning Briefing by Email What you need to know to start your day, delivered to your inbox Monday through Friday.

Lt. Randall J. Clark, Mr. McCloughan’s onetime platoon leader, had inquired after the battle about awarding the medic the Distinguished Service Cross, but he was given a bronze star for valor instead. It was not until 2009, when Mr. McCloughan’s uncle secured him a meeting with Representative Fred Upton, Republican of Michigan, that the topic was revisited. With the help of Mr. Clark, Mr. Upton and Michigan’s congressional delegation, the case eventually got the attention of Ashton B. Carter, President Barack Obama’s defense secretary, who recommended last year that Mr. McCloughan be awarded the Medal of Honor.

But because the award must be given within five years of the actions it recognizes, Congress had to vote to grant special permission. By the time it had done so, the Obama administration ran out of time to invite Mr. McCloughan to the White House.

Mr. McCloughan, who was known as Doc to members of his platoon, was drafted into the Army shortly after he finished college, in 1968. By March 1969, he was assigned to a base in South Vietnam and two months later found himself part of a dwindling company tasked with securing a transportation route near Tam Kỳ.

When they flew by helicopter into the area, the Americans almost immediately came under fire. Though they did not realize it yet, more than 2,000 North Vietnamese and Vietcong soldiers had their position surrounded. With his company under fire and in retreat, Mr. McCloughan hoisted his first downed soldier onto his shoulders and evacuated him to safety.

By late afternoon, he again sprinted forward, weaponless, to pull two more stranded men back to a trench (likely dug by French troops in the 1950s). This time, he was hit. Mr. McCloughan looked down and saw he was covered with blood. Shrapnel from a rocket-propelled grenade had hit his head and body.

Over the two-day battle, Mr. McCloughan voluntarily risked his life seven more times, according to an account of the battle released by the White House, returning fire and, in one case, taking out an enemy rocket-propelled grenade position. When a superior ordered him to get in a medevac helicopter alongside one of the men he was treating, Mr. McCloughan refused.

“As Jim now says,” Mr. Trump said, “‘I would have rather died on the battlefield than know that men died because they did not have a medic.’”

By May 15, when the fighting subsided, Mr. McCloughan had been without food, water or sleep for two days. He collapsed from dehydration after loading medevac helicopters.

Hours before that, as he evacuated another man badly wounded in the stomach, Mr. McCloughan turned his thoughts to home and proposed a deal with God, Mr. Trump said.

“He asked God,” Mr. Trump said. “‘If you get me out of this hell on earth so I can tell my dad I love him, I will be the best coach and the best father you could ever ask for.’”

The president said both sides had held up their end of the bargain.