An NYPD officer who was beaten up by other cops at his Queens home when he was off duty nearly eight years ago settled with the city on Wednesday for $5 million.

In 2016, a Brooklyn federal jury awarded Larry Jackson a staggering $15 million payout after cops battered and choked him while responding to a 911 call at his daughter’s birthday party.

That number was slashed to $5.425 million in August by Brooklyn federal Judge Pamela Chen after the police department protested that the figure was too high.

“Settling this longstanding case was in the interest of all parties,” said a spokesman for the city Law Department.

In the judge’s decision recommending the lower settlement amount, she wrote, “Plaintiff went through an undeniably traumatic experience that has scarred him both physically and emotionally for life.”

But she added that the jury’s eye-popping $15 million award is “beyond any reasonable amount of compensation in cases such as this.”

Jackson was throwing his daughter’s birthday celebration on Aug. 21, 2010, when his wife called 911 to report a man outside the house who appeared to have a gun, court papers state.

Once cops arrived, Jackson identified himself as a fellow officer. But the group of more than a dozen cops either stood idly by or participated in the vicious attack, punching Jackson in the face and head and choking him with a baton.

Jackson fled outside to the street and was pursued by the officers, who struck him with batons upwards of 20 times and pepper-sprayed him, according to court papers.

After cops found his police identification, they released him. He was never charged with a crime. He suffered a fracture to his shooting hand, the filing says.

“This is vindication,” Jackson’s attorney Eric Sanders said of the settlement. “But the problem is the city still didn’t do the right thing because the cops who were involved in this shouldn’t be police officers.”

Jackson, who is still working as a transit cop, believes he was targeted because he’s black.

City lawyers argued at trial that Jackson had punched one of the officers.