PHILADELPHIA — The Philadelphia Police Department is renaming its valor medal for an officer who took on two armed robbers and continued firing until he was mortally wounded, the police commissioner said Saturday at the slain officer’s funeral.

Commissioner Charles Ramsey called the actions of Officer Robert Wilson III inside at a north Philadelphia video game store the greatest act of bravery he’s seen in his 46-year career.

“He never stopped until that fatal round was fired,” Ramsey said, standing on a stage above Wilson’s open casket.

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

Nutter told thousands of mourners, many police officers in dress blue, that the city has lost a friend, a brother and an American hero.

Nutter said the 30-year-old Wilson fought valiantly to save patrons and staff members at the GameStop store after two brothers armed with semi-automatic weapons opened fire on March 5.

The 8-year department veteran had stopped at the store to buy a gift for his son who had excelled in school and was turning 10 in a few days.

Wilson’s partner, who was outside, shot one of the suspects in the leg as they attempted to flee.

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 reminisced about the fun they 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.

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

Nutter recited a list of officers killed over the last nine years and encouraged police officers and residents to bridge the divide that has led to mistrust and violence.

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

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

Attorney General Eric Holder on Friday called the episodes 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.”