Upper East Side shipping magnate Oleg Mitnik says the feds have sold him out by letting free two men accused of plotting his murder.

“The man who was supposed to kill me is out after 16 or 17 months, and the guy who ordered my murder, he’s walking free. So that’s justice,” Mitnik told The Post.

“I am terrified.”

So Mitnik is turning to a different venue in his search for justice — Manhattan Supreme Court.

He is suing his father-in-law, Anatoly Potik, and his estranged wife, Ronit Mitnik, for $20 million for emotional distress and defamation.

The alleged murder-for-hire scheme unfolded amid Mitnik’s bitter, ongoing divorce from Ronit, a socialite.

Mitnik says the aging Potik is one of the people who plotted his death. He identifies the other as Boris Nayfeld, 70, whom feds have long linked to the Russian mob.

Potik was arrested in January 2016 and charged with hiring Nayfeld to kill Mitnik. The price was $100,000.

If Potik’s alleged plot had succeeded, his daughter would have benefitted from Oleg Mitnik’s $7 million life-insurance policy.

She also would have inherited their $9 million worth of real estate, including a Manhattan condo and a vacation home in Quogue, LI, Oleg Mitnik alleges in his suit.

Mitnik says he thwarted the murder plan by calling the cops and offering Nayfeld $125,000 to call off the hit.

The feds picked up both men, but they eventually dropped their case against Potik, citing his deteriorating health.

Potik has a criminal history dating to 1985 and allegedly told Oleg Mitnik that he used murder “to resolve business disputes in the past,” according to the lawsuit.

“He’s a very dangerous man. Somebody who smiles in your face and stabs you in the back,” Oleg Mitnik said. “Every time I walk out of my building, I have to look left and right, and take different exits and take different roads.”

“They think I’m safe now and that he is not capable to do anything because it’s in the public eye,” said Mitnik, who has started carrying a gun.

Nayfeld — who admitted his role in the case — was freed on probation in October.

Nayfeld told The Associated Press in January that he would like to go back to Russia, and that the two years he spent locked up for plotting to kill Mitnik was punishment enough.

“I lost everything,” Nayfeld told the AP. “I lost job, I lost my time for stay in prison. I lost my wife. This is enough punish for me.”

But Mitnik doesn’t buy it.

Mitnik believes his father-in-law, who he says has deep ties to the Russian and Italian mobs, was let off easy because he helped authorities investigate other crimes.

“They basically sold me out for cases. I think it sends the wrong message,” Oleg Mitnik said of federal prosecutors.

Mitnik contends in court papers that his wife and her father have tarnished his name by spreading rumors that he framed Potik by cooking up false allegations of a murder plot and by paying off federal agents.

“I think it will clear my name,” Oleg Mitnik said of the civil lawsuit. “I think it’s important for justice to be served at least at some angle.”

Ronit Mitnik’s lawyer, Robert Wallack, dismissed the allegations as “total fiction” and “utter garbage.”

The murder plot was allegedly hatched after Potik testified in his daughter’s divorce case, then flew to Moscow to meet with Nayfeld at the Azimut Olympic Hotel, says Mitnik’s lawsuit.

Around the time Potik went to Russia, Ronit Mitnik forbade their daughter from riding in Oleg Mitnik’s car, claiming a routine trip across Central Park to school was “too dangerous,” the husband said in court papers.

Oleg Mitnik says Ronit Mitnik’s claim that he had invented the murder plot has driven a rift between him and their two children — a 19-year-old son and 18-year-old daughter.

“I want peace for my family … I want to move on,” he said.