WHITE PLAINS  Bernard B. Kerik, a former detective who rose to lead the New York Police Department through the 9/11 attack before his career crumbled in scandal, pleaded guilty Thursday to eight charges including tax fraud and lying to White House officials.

Wearing a blue suit and a red tie in Federal District Court here, Mr. Kerik sat at the defense table in the packed courtroom with a subdued expression. In a deep, gravelly voice, he said, “Guilty, Your Honor,” as the judge read the charges against him.

One of his lawyers, Michael F. Bachner, rubbed Mr. Kerik’s back during the 90-minute proceeding.

The prosecution and the defense recommended that the judge, Stephen C. Robinson, sentence Mr. Kerik, who faced up to 30 years in prison on the most serious charge, to 27 to 33 months. The judge, who is not bound by the recommendation, set sentencing for Feb. 18. Mr. Kerik was also ordered to pay restitution of nearly $188,000.

The tax fraud charges stemmed in part from Mr. Kerik’s acceptance of $250,000 in renovations to his Bronx apartment, provided by a company accused of having ties to organized crime. He also admitted lying to White House officials, denying improprieties, while he was being interviewed to be head of the Department of Homeland Security.