The NYPD paid Spike Lee — one of its fiercest critics — more than $200,000 to help launch a new policing program aimed at improving relations with minority communities.

The department tapped the “Do the Right Thing” director in 2016 as a consultant for the campaign, a spokesman for the department’s nonprofit New York City Police Foundation confirmed Thursday.

The contract with Lee’s advertising firm, Spike DDB, was for $219,113 — which was paid for by the Police Foundation.

“The Foundation approached and consulted several creative teams including the Spike DDB agency to help develop a public awareness campaign that would aim to strengthen the partnership between the NYPD and the communities it serves,” said spokesman Brady Littlefield. “We received tremendous input and ideas, and that process ultimately resulted in last spring’s neighborhood policing ad campaign.”

The partnership was revealed in the Police Foundation’s most recent tax filing covering some of 2016 and 2017.

In 2014, Lee — a frequent fixture at Black Lives Matter rallies — created a mashup of clips from his critically acclaimed movie “Do the Right Thing” and footage from Eric Garner’s chokehold death.

In the 1989 movie, Lee’s character Radio Raheem, a black man, is choked to death by NYPD officers, inciting race riots.

“Radio Raheem And The Gentle Giant,” Lee captioned a screenshot of his video, which he linked to from his Instagram account.