Det. Steven McDonald, an NYPD officer who inspired others by forgiving the teenager whose bullet left him a quadriplegic and overcoming his disabilities to remain an active cop, died Tuesday at North Shore University Hospital in Manhasset, officials said. He was 59.

McDonald, a Malverne resident, died at about 1:09 p.m. following four days on life support after suffering an apparent heart attack Friday, a source said.

Law enforcement sources said McDonald never regained consciousness and showed virtually no brain activity in the days following his hospitalization.

In a written statement, New York City Mayor Bill de Blasio praised McDonald for being the city’s “greatest example of heroism and grace.”

“I will forever cherish my last conversation with Detective McDonald, late last year,” de Blasio said.

“His words encouraged all of us to continue to bring police and communities closer together.”

Officials said a full NYPD funeral was planned for 9:30 a.m. Friday at St. Patrick’s Cathedral in Manhattan. Cardinal Timothy Dolan, a close friend of McDonald, will officiate, said a spokesman for the Archdiocese.

Sign up for The Classroom newsletter. Education on Long Island is changing. Find out how. By clicking Sign up, you agree to our privacy policy.

A public wake is planned for Wednesday and Thursday at the St. Agnes Parish Center adjacent to St. Agnes Cathedral in Rockville Centre on Quealy Place. Visitation on both days is from 2 to 4 p.m. and 7 to 9 p.m.

Hundreds of officers gathered Tuesday at the Manhasset hospital in the hours before McDonald’s death, police officials said.

For about two hours, cops filed into McDonald’s room to say goodbye.

Afterward, his wife, Patricia Ann, the mayor of Malverne, and son, Conor, an NYPD sergeant, entered the room for a quiet moment, said a union official present at the hospital.

Then, the life support system that had sustained McDonald was shut off and he died, the official said.

Cop who made a difference

NYPD Commissioner James O’Neill said in a statement that McDonald’s life is one others would do well to emulate.

“No one could have predicted that Steven would touch so many people, in New York and around the world,” O’Neill said.

“Like so many cops, Steven joined the NYPD to make a difference in people’s lives. And he accomplished that every day. He is a model for each of us as we go about our daily lives. He will be greatly missed, and will always remain a part of our family.”

In a Facebook post, Conor McDonald said of his father: “You have fought the good fight. You have finished the race. You have kept the faith. You have made me the man I am today. I love you forever. . . . I’ll see you later Pop.”

A bullet, then forgiveness

The violence that changed Steven McDonald’s life and spurred so many others to find inspiration in his tenacity, grit and most of all, forgiveness occurred in July 1986 as he patrolled Central Park.

A bullet fired by 15-year-old Shavod Jones left McDonald paralyzed from the neck down.

Jones served time in prison for attempted murder and died in a 1995 motorcycle crash just days after his release.

Despite McDonald’s devastating injury, which required the help of a respirator for breathing and a wheelchair for mobility, McDonald remained an active member of the NYPD and eventually regained the ability to talk.

Eight months after the shooting, McDonald forgave Jones.

That act, an unlikely gesture in the minds of some, led McDonald — who remained on active duty — to give inspirational talks at public and parochial schools about the meaning of forgiveness.

He also lectured police officers about the importance of their work. McDonald was eventually promoted to lieutenant and detective.

Lesson in how he lived

“If anybody had the right to feel hostility toward his assailant it was Steven but he transcended hatred and was able to publicly forgive,” said Detective Endowment Association President Michael Paladino.

Patrick Murphy, president of the Patrolmen’s Benevolent Association lauded McDonald for his courage and being the most “forgiving man I have ever known.”

“He was a true American hero” Murphy said in a statement.

Longtime Queens District Attorney Richard Brown also noted McDonald’s heroism, adding that when confronted with adversity he “responded with courage, grace and dignity. I was proud to call him my friend.”

It wasn’t just cops and law enforcement brass speaking out Tuesday about the friend they lost and his lasting influence.

McDonald was an avid New York Rangers fan. In a statement, the team described him as someone who “exemplified the true meaning of the word hero and also personified the ‘Blueshirt Faithful.’ He is an inspiration to us all and his legacy will continue live on in our hearts and minds.”

Nassau District Attorney Madeline Singas highlighted McDonald’s ability to forgive the man whose act made him rely on a wheelchair as well as his message of peace.

Officials said the NYPD will likely determine that McDonald lost his life because of the shooting.

It is an important distinction because if McDonald’s death is deemed to have occurred in the line-of-duty death, his wife would be entitled to his full NYPD pension.