But Judge Sullivan refused to release Mr. DiPascali on bail after his plea, despite a request by prosecutors that he remain free to better assist their complex wide-ranging investigations, a jolt to both the government attorneys and the defense lawyers.

Judge Sullivan said he was not persuaded that the bail terms  a $2.5 million bond agreement reached between the prosecution and defense lawyers  would ensure that Mr. DiPascali, who is 52, would show up for sentencing, which has been tentatively set for next May.

Mr. DiPascali, who had been one of Mr. Madoff’s closest aides for decades, also said he would “dedicate all my energy to trying to explain to others how this happened” as a cooperating witness for federal prosecutors who are still investigating Mr. Madoff’s vast crime, which left his clients bereft of almost $65 billion they thought was in their accounts.

Mr. DiPascali is facing up to 125 years in prison; his former boss was sentenced in June to 150 years. “The defendant has ample incentive to flee,” the judge said, adding that the bail arrangements amounted to little more than “an honor system.”

Image A court rendering of Frank DiPascali, center, a long-time aide to Bernard L. Madoff. Credit... Christine Cornell/Agence France-Presse — Getty Images

Marc L. Mukasey, defending Mr. DiPascali, repeatedly assured the judge that Mr. DiPascali knew his only hope for leniency was to cooperate. Indeed, Mr. Mukasey said, he has already earned the trust of prosecutors and investigators. Moreover, he said, Mr. DiPascali is part of a close and loving family, some of whom would incur significant losses if he were to flee before sentencing.