Richard B. Costello, 70, of Southampton, a former captain with the Philadelphia Police Department and past president of its officers union, died Thursday, Dec. 2, of heart failure at the Hospital of the University of Pennsylvania.

Capt. Costello was a police officer for more than three decades, and president of the Fraternal Order of Police Philadelphia Lodge No. 5 for a record five two-year terms. His career was dramatically altered in December 1973 when he was shot twice in the head while on patrol just three months after joining the department.

That incident, from which he recovered and returned to full-time administrative duty, and his ensuing confrontations with the department about rehabilitation benefits and compensation, helped motivate Capt. Costello to seek leadership roles with the FOP.

As union president — from 1988 to 1990, and 1994 to 2002 — he was out front in negotiating with city officials for better benefits, pay, work schedules, and other issues for the more than 6,000 officers.

Colorful, opinionated, intelligent, and often biting in his public statements about city officials, state representatives, and others he saw as adversaries, Capt. Costello coordinated hundreds of responses to issues involving his members, and represented the union to the media and public.

He was unopposed for reelection in 2000, the first time since 1939 that an incumbent FOP president drew no challengers.

“Maybe I have the only job that nobody wants,” he told The Inquirer. Earlier, he worked as the union’s recording secretary, benefits administrator, and unit director.

“Rich fought for Philadelphia Police Officers and their families for decades ensuring they were treated and respected like the heroes they are,” the FOP said in a statement.

One of his colleagues wrote in a tribute: “Rich was not only his name but also his character. He was a solid human being and a cop’s cop.”

In 2008, Capt. Costello resigned from the department and ran as a Democrat against Republican John M. Perzel for a seat in the Pennsylvania House of Representatives. The Daily News editorial board wrote: “Rich Costello, whom we endorse, is smart and thoughtful.”

He lost the election.

Most recently, he served as a senior adviser to union leaders in their just-completed contract talks with the city.

“The police were his other children,” said Capt. Costello’s son Mike. “He went out of his way quietly to help people over the years. He always said, ‘Do the right thing,’ and, ‘Your word is your bond.’”

Born April 6, 1951, in Philadelphia, Capt. Costello attended Gwynedd Mercy Academy and Holy Ghost Preparatory School. He graduated from what was then St. Joseph’s College with a bachelor’s degree in political science in 1973, and planned to become a lawyer and perhaps district attorney.

He joined the Police Department first, his son said, to get personal experience in the justice system. Instead, a two-year rehabilitation followed his 1973 shooting. He was left deaf in his left ear, and one of the bullets remained lodged in his skull for the rest of his life. His assailant was never found.

On his off days, Capt. Costello liked to read about history and play board games that required strategy and thought. He was interested in the lives of his children and grandchildren, and kept detailed logs of his own activities.

He was married and divorced twice, and most recently spent time with partner Cheryl Butman. Even away from the cameras and microphones, he was known for his clever quips.

“A tough cop. A fierce warrior, leader and defender of police,” his family wrote in a tribute. “He will be missed immeasurably.”

In addition to his son and partner, Mr. Costello is survived by sons Jack and Jimmy; daughters Elizabeth, Marie, and MaryKate Black; former wives Mary Ellen Golden and Donna Costello; four grandchildren; a brother; a sister; and other relatives.

Services were Thursday, Dec. 9, and Friday, Dec. 10.

Donations in his name may be made to the FOP 5 survivors fund, FOP Lodge 5, 11630 Caroline Rd., Philadelphia, Pa., 19154, and the Police Athletic League of Philadelphia, 3068 Belgrade St., Philadelphia, Pa. 19134.