It was the summer of 1986, midway through a decade when crime seemed to be out of control in New York City and racial turmoil lurched from one breaking point to another.

Crack cocaine was coursing through minority neighborhoods, while homicides were inching toward 2,000 a year. The Rev. Al Sharpton was cementing his reputation as a racial provocateur. It seemed as if Mayor Ed Koch couldn’t attend a black church without being booed out of the building. A black drug dealer named Larry Davis shot six white cops.

Into that toxic stew fell Steven McDonald, a third-generation NYPD officer.

On July 12, 1986, he and his partner, anti-crime cops in plainclothes, responded to a call of a robbery in Central Park. As they questioned three black teenagers, one of them, 15-year-old Shavod Jones, turned and fired. He struck McDonald three times, shattering his spine and permanently paralyzing him.

McDonald was 29 years old, with a pregnant wife and his life laid out in front of him. He would live the next 30 years on a ventilator as a quadriplegic — but he was not embittered. Instead, McDonald, who died Tuesday after a heart attack, became the embodiment of unfathomable forgiveness and touched so many lives. NYPD Commissioner James O’Neill called him a “source of inspiration and incredible hope to people the world over.”

McDonald’s funeral is set for today at St. Patrick’s Cathedral.

One might have expected McDonald’s tragic shooting to exacerbate New York City’s already roiling divisions and bitterness. Instead, at his son Conor’s baptism in early 1987, McDonald forgave Jones, in a statement read by his wife, Patricia Ann.

“I forgive him and hope he can find peace and purpose in his life,” McDonald wrote. His act was an anomaly in a city that later in the decade was rocked by the arrest of five black teenagers on charges of raping of a white female jogger in Central Park — a crime, it turned out, they didn’t commit.

Jones never did find peace and purpose. He was convicted of attempted murder and served eight years in prison. Four days after he was paroled, he died of head injuries sustained in a motorbike accident in his old East Harlem neighborhood.

Instead, it was McDonald who found peace and a new purpose in his life. With Patricia Ann, now the mayor of Malverne, and Conor, now an NYPD sergeant, at his side, he became an inspiration to people in and out of the NYPD.

Although confined to a wheelchair and speaking haltingly, he was present at virtually all significant NYPD functions — especially at times of adversity, supporting cops via many NYPD organizations and prayer groups. With another iconic figure, the Rev. Mychal Judge, the Fire Department chaplain killed in the Sept. 11 attacks, McDonald traveled to Northern Ireland, seeking reconciliation between Protestants and Catholics.

“I think of him as the patron saint of the NYPD,” said former NYPD First Deputy Commissioner George Grasso, now the supervisory judge of Bronx Criminal Court. “The virtues he showed, the way he lived his life, his power of forgiveness — to say he represents the best of the best is an understatement. No one can put into words how he lived and the love he showed.”

Said Patrick Lynch, the president of the Patrolmen’s Benevolent Association, “Steven McDonald was the most courageous and forgiving man I have ever known. Despite the tremendous pain in his life, both physical and emotional, his concern for his fellow police officers and for the people of New York City never wavered.”

It’s doubtful anyone would disagree.

Journalist Len Levitt writes the “NYPD Confidential” column.