WASHINGTON, June 23 (Reuters) - President Barack Obama will award former Army Staff Sergeant Ryan Pitts the Medal of Honor, the highest U.S. award for heroism, on July 21 for gallantry during one of the bloodiest battles of the Afghan war, the White House said on Monday.

Pitts, of Nashua, New Hampshire, will be the ninth living recipient of the Medal of Honor for fighting in Iraq or Afghanistan, the Defense Department said.

Pitts is set to receive the Medal of Honor at a White House ceremony for his actions as a forward observer during a July 13, 2008, battle at Wanat, a village in eastern Afghanistan's Kunar province.

He was serving with the 503rd Infantry Regiment, 173rd Airborne Brigade, at Vehicle Patrol Base Kahler when the post was attacked by Taliban fighters who broke through U.S. lines, the Pentagon said.

Pitts was at an observation post that was hit with small arms fire, rocket-propelled grenades and hand grenades, officials said. Pitts and six other paratroopers were wounded in the initial enemy fire, the Pentagon said.

Although he had grenade shrapnel in both legs and his left arm, he fought for more than an hour to defend his position, officials said.

Pitts' toughness and ability to communicate with officers under fire was crucial to thwarting enemy efforts to take the outpost, the Pentagon said. Capturing the post would have given the Taliban high ground overlooking the base, it added.

Nine soldiers were killed in the fighting and 27 wounded, the U.S. military said. U.S. and Afghan forces withdrew from the base two days later, and the U.S. combat deaths were the most in a single battle since 2005.

An Army review led to recommendations to discipline three officers in the battalion and brigade. The officers were exonerated after an appeal and further review, the Army said in 2010.

Pitts left the Army in October 2009 after being treated at Walter Reed Army Medical Center, officials said. He works in business development for the computer software industry, the Defense Department said. (Reporting by Ian Simpson; Editing by Will Dunham)