It started as just another police DWI stop on Manhattan’s Lower East Side — a gold, two-seater Audi with three people crammed inside, including a driver who reeked of booze.

But when Officer Joseph Stokes pulled over the fancy sports car at 5 a.m. on April 19, 2018 — and the driver allegedly spat out, “I’m going to make you f–king pay!” and flashed phone photos of himself with top police brass, including then-Commissioner James O’Neill — the cop’s life was forever changed.

In legal papers, Stokes says the NYPD has orchestrated a campaign of revenge against him, ­including a harrowing Internal Affairs sting, a demotion and the leaking of false accusations that he was a dirty cop — all, he says, because he arrested a well-connected drunk.

“I lost the love for this job after seeing how dirty they are,” Stokes, 40, told The Post.

“I wouldn’t even want my kids to be a cop anymore,” said the dad of seven, who has filed a notice of claim alerting the city he intends to sue it, the NYPD and the Manhattan district attorney for $100 million.

On the day he pulled over the Audi, Stokes was a decorated, 12-year veteran, a “training officer” who taught new cops the ropes at the 7th Precinct.

“His integrity is unquestionable, and his compassion,” said his lawyer, Joseph Murray.

Then he and three other officers pulled over the driver, identified in Stokes’ court papers as “the Motorist,” but who The Post has learned through arrest records was Brooklyn restaurateur Johan Dawood, 38.

In a failed attempt to avoid a DWI rap, Dawood scrolled through his cellphone and “showed Stokes several pictures of the Motorist with O’Neill and [NYPD Chief Jeffrey] Maddrey,” and tried to phone O’Neill and Maddrey, “all with negative results,” Stokes claims.

Dawood, who owns three restaurants and also uses the name Jouhan Daoud, blew a .153 percent blood alcohol content on his roadside breath test — nearly twice the legal limit — and was charged with driving while intoxicated, records show.

Then began almost two years of what Stokes calls harassment. First, “the Motorist” falsely told NYPD Internal Affairs that Stokes stole $30,000 in cash from the Audi — something he and the three officers with him deny and were never charged with, the court papers state.

Then, on Oct. 29, IAB conducted a sting in which an undercover pretended to be a drunk with $1,500 cash in his car — in a failed attempt to entrap Stokes into stealing the loot, the court papers allege.

Stokes had vouchered the undercover’s cash in the presence of other precinct cops and with his bodycam rolling, but was still arrested and held for seven hours.

In that time he was transported from the 7th Precinct to prosecutors’ offices on Wooster Street, then to the DA’s main offices at 1 Hogan Place, then to Manhattan North Internal Affairs, where he was released with no charges and later demoted to a new assignment in The Bronx.

“Nobody ever signed off on this,” Stokes overheard an angry official say while he was at 1 Hogan Place, the papers allege. “This was not authorized . . . we’re leaving.”

Meanwhile, a story about Stokes’ arrest was maliciously leaked to news outlets, including The Post, the papers state.

And Stokes was denied access to a lawyer or a union delegate, in violation of his legal rights and NYPD policy, Murray said.

He was “never fingerprinted, never photographed, never nothing,” Stokes told The Post.

O’Neill and Maddrey targeted Stokes “in retaliation of Stokes’ lawful and dutiful arrest of the Motorist, who is a friend and donor to O’Neill and Maddrey,” the papers allege.

The NYPD, O’Neill and ­Dawood did not comment on the allegations.