An ex-NYPD sergeant will serve 3 months of weekends in jail after pleading guilty in Manhattan today to perjury and three counts of official misconduct.

The plea by William Eiseman, 42, stems from testimony he gave two years ago in which he lied under oath that a defendant had admitted drugs were in his apartment.

Eiseman also admitted today that he conducted unlawful searches on three occasions between 2007 and 2008, while working as a supervisor for the NYPD Impact Response Team and the Manhattan North Task Force.

The ex-cop’s lawyer insisted that his client had not committed an act of corruption, but was merely doing the right thing the wrong way.

“He never once arrested an individual who was not guilty of a crime,” said the lawyer, Andrew Quinn.

Eiseman’s co-defendant, Officer Michael Carsey, 30, is scheduled for trial Aug. 29 on charges of perjury, offering a false instrument for filing and official misconduct. He has pleaded not guilty.

Prosecutors say that in 2008, he joined with Eiseman in an unlawful stop and detention which led to a court-authorized apartment search. The two later lied about the search in testifying under oath in Manhattan Supreme Court, prosecutors say.

“He abused his authority and lied under oath, violating the public’s trust,” said Manhattan DA Cyrus Vance.

“His guilty plea to a felony means that he will be removed from the police force, and will no longer be able to represent New York’s Finest.”