In the wake of his conviction in the United Nations bribery trial, Chinese billionaire Ng Lap Seng will be allowed to remain in an apartment guarded by private security but must keep his bedroom door open during visits from his masseuse, a Manhattan federal judge ruled on Monday.

U.S. District Judge Vincent Broderick refused a government request to jail Ng, 69, who had been allowed to stay in his $4 million Manhattan apartment while paying private security guards to watch him for nearly two years as he awaited trial. Ng was convicted on July 27.

Broderick said, however, that he was going to tighten conditions — limiting visitors; requiring everyone to be searched with a metal detector by guards from Guidepost Solutions; and ordering a Chinese interpreter to be there during waking hours as well as doors inside the apartment to stay open.

During questioning by Broderick and prosecutor Dan Richenthal, Guidepost supervisor Brendan Finn said a masseuse — a “reputable person” — had been coming to the apartment every other day for the last 22 months.

“The massage takes place in Mr. Ng’s bedroom,” Finn said.

The masseuse had been staying for 4 to 10 hours a day, Richenthal said.

“One would assume more is going on than just massage,” the prosecutor said. Finn said that in addition to massaging Ng, the Chinese masseuse also cooked meals and sometimes fed the security detail. Broderick said that would have to stop as part of tighter, post-conviction security.

“To the extent there is food cooked in the apartment, you should get food elsewhere,” the judge said. “ . . . In terms of the masseuse, I would just ask that the door be open.”

Ng, a developer from Macau, was convicted of paying off two Caribbean ambassadors to grease the way for UN support of a convention center for developing nations he wanted to build to anchor a massive hotel and real estate project on a man-made island. In 2015, Broderick concluded that Ng was a flight risk, but approved an unusual arrangement under which he has paid Guidepost — a company owned and staffed by ex-law enforcement personnel — an estimated $35,000 a week to post armed guards to keep him from running away.

Richenthal argued that, in the wake of his conviction, the incentive to flee had become greater and it was time for the arrangement to end.

“It is literally impossible to imagine a defendant with greater incentive to flee and greater resources to do so,” he said.

Ng’s lawyers said the Guidepost arrangement made flight a virtual impossibility, and their client has potent legal issues to raise with Broderick to try to overturn the verdict.

Broderick said he wasn’t committing to letting Ng stay in his condo after his sentencing — which has not yet been scheduled — while he pursues a likely appeal, but wasn’t ready to put him in jail yet.

He has barred Ng’s trips to the gym in his building for workouts, which were permitted pretrial, and said that open doors and a roaming interpreter — none of the Guidepost staff speaks Chinese — would ensure against nefarious plotting.

Responding to prosecution complaints that Ng has been visited by a growing number of his business associates since his conviction, Broderick said any visitors other than family will have to be cleared both by him and the government, and the guard contingent will have to grow from two to three when more than four visitors are present.

The judge also ordered that Guidepost share with the government a video feed from the condo.