A Michigan man who spent 45 years behind bars for a crime he didn’t commit — the longest a wrongfully convicted person has ever served in America — will get a $1.5 million payout from the state.

Richard Phillips was 27 years old when he was imprisoned for a fatal shooting in Detroit in 1971 — a case prosecutors now say was “based almost entirely” on false testimony from one witness. He was sentenced to life without parole.

The former auto worker is now 73.

He was exonerated in 2018 after the University of Michigan’s Innocence Clinic took up his case, declaring him the longest-imprisoned innocent man in America.

The clinic found that a co-defendant told the parole board in 2010 that Phillips had no role in the slaying, the Detroit Free Press reported.

Phillips maintained his innocence during his more than four decades in prison.

“I would rather die in prison than to admit to something that I didn’t do,” he told WDIV television last year.

In order to support himself as he waited for officials to determine his restitution, Phillips sold paintings he had made while locked up.

In Michigan, exonerees can quality for $50,000 for every year spent in prison — meaning Phillips stood to collect more than $2 million. He is only receiving 30 years’ worth of restitution because he was serving a concurrent sentence for a separate armed robbery conviction.

His lawyers claim he was wrongfully convicted in that case, too, but prosecutors haven’t acquitted him.

“Re-entering society is profoundly difficult for wrongfully convicted individuals,” Michigan Attorney General Dana Nessel said. “We have an obligation to provide compassionate compensation to these men for the harm they suffered.”

With Post wires