President Obama awarded the Medal of Honor posthumously on Wednesday to a Green Beret who died to save his fellow soldiers in a pitched battle with insurgents in Afghanistan last year, the latest in a series of such tributes at a time of domestic debate about the war.

Staff Sgt. Robert J. Miller’s unit was ambushed on Jan. 25, 2008, during a predawn reconnaissance mission in Gowardesh by enemy fighters who assaulted them from above. Under withering fire, Sergeant Miller charged forward and drew fire away from his fellow soldiers. Even after he was shot, he continued returning fire to allow his team to pull back.

Ultimately, according to a Pentagon account of the seven-hour battle in Kunar Province, Sergeant Miller killed at least 10 insurgents while saving the lives of 7 American and 15 Afghan soldiers.

Mr. Obama presented the medal to Sergeant Miller’s family in a ceremony in the East Room of the White House. “You gave your oldest son to America,” he told the soldier’s parents, Phil and Maureen Miller, “and America is forever in your debt.”