The ongoing NYPD corruption trial descended into chaos Tuesday morning as two lawyers got into an argument over the government’s star witness that devolved into one of them getting shoved in the chest.

Defense lawyer John Meringolo, who represents ex-NYPD Deputy Inspector James Grant, admitted he pushed prosecutor Martin Bell but claims it was because he felt “threatened.”

“I did not pop him in his mouth, but I pushed him away from me,” Meringolo told Manhattan federal court Judge Gregory Woods.

Bell said he confronted Meringolo in the hallway of the Pearl Street courthouse claiming the defense attorney had improper contact with a witness, Jona Rechnitz, earlier in that morning.

“Mr. Meringolo apparently walked up to Mr. Rechnitz and said something along the lines of: You’re a disgrace,” Bell told the judge. “This was something heard not only by Mr. Rechnitz, but by the FBI agent and by Mr. Rechnitz’s counsel, Allen Levine, an officer of the court.”

The heated exchange happened outside the 26th floor courtroom and before the trial started for the day.

“I came out to Mr. Meringolo and told him, essentially, if you wake up and do something like that again, you’d better apologize,” said Bell in court. “That’s incredibly improper.”

A witness told The Post that Bell barreled out of the courtroom, warning Meringolo, “You gotta wake up from this dream.”

Meringolo angrily responded, “Who the f–k do you think you’re talking to?” while shoving Bell away, the witness said.

Bell said he never got physical with Meringolo.

“He shoved me in the chest. There was no contact on my part,” Bell said.

Meringolo, a well-known mafia lawyer whose clients once included John “Junior” Gotti and reputed Philadelphia mob boss Joey “Skinny Joey” Merlino, denied saying anything to Rechnitz — and claimed footage from the courthouse hallway will prove it.

The tapes don’t pick up audio, sources said.

“It didn’t happen with Rechnitz. It did not happen,” Meringolo insisted to the judge. “[Bell] came out and threatened me. You’re not allowed to come out running the court, run in the hallway, and move towards me, and threaten me, and threaten my life. You’re not allowed to do that. You can’t do that.”

Meringolo said four or five people in the hallway witnessed the scuffle between him and Bell.

“Where the cameras? The cameras are here. Where are the FBI agents? Let’s put everybody on the stand,” he said in the courtroom.

Bell initially floated the idea of requesting that Meringolo be either sanctioned or charged with contempt but then said he wouldn’t pursue either punishment.

The judge said he would pull the tapes and ordered the lawyers back for a hearing at 1 p.m.

Jurors on the case were dismissed for the day.

“I’m concerned about this ending in a mistrial. I would like to have this all calm down,” Reichberg’s lawyer Susan Nechles said.

“It’s a freighted and unfortunate resolution for what is clearly a freighted and unfortunate situation, one that, in any event, should not have occurred,” said Woods. “I’d like to give the parties an opportunity to take a deep breath, and walk around the block.”

Rechnitz has been testifying against Grant and his co-defendant Jeremy Reichberg, a self-described Brooklyn police liaison who is charged with bribing the highest ranks of the NYPD, including Grant and others.

Grant is accused of accepting the kickbacks, including a ride on a private plane with a hooker, in exchange for doling out police favors.

Prosecutors were expected to wrap up direct examination of Rechnitz on Tuesday.

Tensions have been running high at the corruption trial, which began earlier this month, and Woods has previously reprimanded Meringolo for “ejaculations of outrage.”