WASHINGTON — Cpl. William Kyle Carpenter, an automatic rifleman who shielded a fellow Marine from a grenade thrown at them during a firefight in Afghanistan in 2010, received the Medal of Honor from President Obama on Thursday.

“Corporal William Kyle Carpenter should not be alive today,” Mr. Obama said during the ceremony. “But we are here because this man, this United States Marine, faced down that terrible explosive power, that unforgiving force, with his own body — willingly and deliberately — to protect a fellow Marine.”

He is the eighth living recipient of the medal for service in Afghanistan or Iraq. The Medal of Honor is the nation’s highest military honor.

In his platoon’s second day of heavy fighting with the Taliban, Corporal Carpenter, then a lance corporal, was stationed on top of a mud hut, alongside Lance Cpl. Nicholas Eufrazio, when a grenade landed on the rooftop. Corporal Carpenter leapt between the explosive and his fellow Marine, absorbing the brunt of the blast with his body.