President Barack Obama on Thursday recognized the heroism of a Union Army officer who was killed during the Battle of Gettysburg, an honor that was more than 150 years in the making.

Obama said he was mindful that he may not be president today if it weren't for the bravery of First Lt. Alonzo H. Cushing and his fellow troops as he awarded First Lt. Alonzo H. Cushing a posthumous Medal of Honor.

"This medal is a reminder that, no matter how long it takes, it's never too late to do the right thing," Obama told about 60 descendants and supporters of the 22-year-old Wisconsin native during a brief ceremony in a windowless White House meeting room.

Helen Loring Ensign, of Palm Desert, California, who is Cushing's cousin two times removed, accepted the framed medal in his honor. Cushing was killed in July 1863 during the three-day battle near the Pennsylvania town, a fight often described as a turning point of the Civil War.

The presentation was all the more extraordinary because recommendations for a Medal of Honor normally must be made within two years of an act of heroism, and the medal presented within three. Congress had to grant an exemption for Cushing's honor.

Cushing was born in Delafield, Wisconsin, raised in Fredonia, New York, and buried at his alma mater, the U.S. Military Academy at West Point.

He commanded about 110 men and six cannons, defending the Union position on Cemetery Ridge against Pickett's Charge, a major Confederate thrust that was repelled by Union forces.

On the third day of battle, Cushing's small force stood its ground under severe artillery bombardment and an assault by nearly 13,000 advancing Confederate infantrymen. Wounded in the abdomen and right shoulder, Cushing refused to move to the rear and insisted on ordering his guns to the front lines.

He was shot and killed as Confederate forces closed in on his position.