An NYPD captain is facing up to a year behind bars for intentionally botching a drunk driving case against an off-duty detective.

Capt. Naoki Yaguchi, executive officer of the 40th precinct in the Bronx, was arraigned Wednesday on charges of official misconduct and obstructing governmental administration for allegedly delaying a breathalyzer test for Detective Efrain Medina.

He is accused of aiding Medina on the night of April 22 following a minor car accident.

Prosecutors say Yaguchi sent a supervisor over to pick Medina up around 9:30 p.m. and then purposely waited until after 11:30 p.m. to give him his breath test — knowing good and well that any breathalyzer administered after the NYPD’s “required observation period” of two hours would be deemed insufficient by the Bronx DA’s office.

There’s just one problem, though — Yaguchi’s union boss, Roy Richter, president of the Captains Endowment Association, claims he doesn’t start working until 11 p.m. so he couldn’t have been responsible for the delay.

“Shockingly, the Bronx District Attorney assigns criminal liability and an indictment against the (Bronx) Duty Captain — who was not even on duty at the time of the incident and initial investigation!” Richter wrote Wednesday in a scathing letter to union members.

“There are so many facts and details to this case that make the action of the Bronx District Attorney even more obscene and totally without basis,” he added. “These facts will come out as we seek a full exoneration of the Duty Captain in a criminal trial.”

Yaguchi was released Wednesday without bail following his arraignment. He’s due back in court on April 3.