Bernard Madoff's right-hand man in his Ponzi scheme pleaded guilty Tuesday to taking part in the massive fraud, saying others, including himself and Madoff, were involved.

But in a surprise move, U.S. District Court Judge Richard Sullivan denied bail for Frank DiPascali Jr., 52, despite his cooperation, which investigators said was helping them decipher the computer data underlying Wall Street's biggest scam.

"I cannot find that Mr. DiPascali doesn't pose a risk of flight," Sullivan said in a ruling that stunned the defendant as well as his attorneys and prosecutors. Sullivan said he couldn't ignore the years of deception by DiPascali, even if he is helping prosecutors.

Frank DiPascali pleaded guilty to several counts, including charges of conspiracy, fraud and tax evasion. He faces a maximum sentence of 125 years in prison. Madoff is serving 150 years in a North Carolina prisonĀ  after being convicted of the $65-billion scam.

As part of his plea deal, DiPascali promised to help the FBI inĀ  unraveling the case, an investigation that many legal observers say is putting a number of key hedge fund managers under the microscope.

Despite strenuous arguments by defense attorney Marc Mukasey that DiPascali never tried to flee even after knowing he was implicated in the scam, Sullivan wouldn't budge on bail. DiPascali put his hand to his face as he saw the tide turn against being set free.

However, Sullivan said Mukasey could renew a bail application, something Assistant U.S. Attorney Marc Litt indicated he favored.

advertisement | advertise on newsday

In a hushed Manhattan courtroom, DiPascali described how he grew up in Queens and, in 1975, took a job with Madoff's investment company. "In 1975 I was a kid from Queens who didn't have a college degree and didn't know anything about Wall Street," said DiPascali, who now lives in Bridgewater, N.J.

But after Madoff moved his operation from Wall Street to Third Avenue, DiPascali described how the investment operation turned into a Wizard of Oz-like operation, with false reports to investors and no securities ever being traded.

By the early 1990s -- and perhaps the late 1980s -- until 2008, "Bernie Madoff and I knew and other people knew no purchase or sale of securities was actually taking place," DiPascali said.

That admission, and the conspiracy charge DiPascali pleaded to, indicated that unnamed others were aware of the fraud.

DiPascali also said he lied to the Securities and Exchange Commission to throw its investigators off Madoff's track.

His voice only broke once when he said how his life was ruined. He also apologized to investors, a few of whom were court. "I apologize to every victim of this catastrophe, to my family and to the government," DiPascali said.