In his final, courageous moments, Officer Robert Wilson III took on two armed robbers and gave his life to save those around him -- an act so noble that Philadelphia's police department will rename its valor medal in his honor, police Commissioner Charles Ramsey said Saturday.

Ramsey recounted Wilson's heroism during the slain officer's funeral, telling thousands of mourners it was the greatest act of bravery he has seen in his 46-year law enforcement career.

"Robert redefined what valor means, in my mind," Ramsey said.

Surveillance video of the March 5 encounter at a GameStop store in north Philadelphia captured the 30-year-old Wilson's unflinching response, Ramsey said.

The gunmen burst in as the 8-year department veteran waited in line to purchase a game for his son, who had excelled in school and was turning 10 in a few days. He instinctively moved from the counter to draw the suspects' gunfire away from innocent bystanders and returned fire, Ramsey said. More than 50 shots were fired during the fierce gun battle, investigators said.

"He never stopped until that fatal round was fired," Ramsey told the assembled crowd, many of whom were law enforcement officers from across the country whose dress uniforms formed patterns of blues and tans inside the Palestra sports arena.

Mayor Michael Nutter said he is struggling to comprehend the loss of the city's 10th police officer killed in the line of duty in the last 9 years.

The city has lost a friend, a brother and an American hero, Nutter said.

"Two cowards came upon him, firing at him," Nutter said. "He fought them valiantly until he could fight no more."

Ramone Williams, 24, and Carlton Hipps, 29, are charged with murder, attempted murder, robbery and other offenses.

"I miss my man," Wilson's partner, Damien Stevenson, told mourners. He shot one of the suspects in the leg as they attempted to flee.

Stevenson reminisced about the fun he and Wilson had on patrol in their car, No. 2222, the time they donned red and white striped socks to entertain children at a Ronald McDonald House and the banter they shared.

"That's all we did, we had fun," Stevenson said, as a video screen displayed images of the partners in their squad car, the slain officer smiling broadly. "There was no car like 22-22."

Wilson will receive the newly renamed medal of valor and the department's medal of honor and a posthumous promotion to sergeant, Ramsey said.

Wilson, known to friends as Rob and Robbie, leaves behind two sons: Quahmier, 10, and Robert IV, a toddler.

He graduated from the police academy in December 2006 after a six-year stint repairing vehicles -- including police cars -- in the city's fleet management department.

Nutter recited a list of officers killed in that span -- the last, Moses Walker in August 2012, worked in Wilson's 22nd District -- and encouraged police officers and residents to bridge the divide that has led to mistrust and violence.

He called the deaths painful and senseless.

"Thank a law enforcement officer today and every day," Nutter said. "Thank a caring and supportive citizen today and every day. All of our lives matter in this world."

Wilson's death came in an uptick in violence against police officers, amid lingering tensions from the deaths last year of unarmed men in Staten Island, New York and Ferguson, Missouri.

Two officers were shot in Ferguson, an officer on New York's Long Island was wounded and a U.S. Marshal in Louisiana was shot and killed in the past week.

Officers bathed in the blue light of police cars stood in a heavy rain and saluted as a horse-drawn caisson carried Wilson's body through the streets of Philadelphia in a predawn procession.

After the service, honor guards from across the region ringed a roadway between the Palestra -- normally the site of athletic triumphs -- as drummers and bagpipers played. Spectators from a lacrosse game at nearby Franklin Field peered at the procession from the top of the stadium.

"Rest easy my friend," Ramsey said. "You did all you could do. No one could have done anything more."