A BROKEN Breathalyzer machine - and a judge's belief that a fired city cop couldn't have been drunk, since he was able to drive down a narrow street after drinking while on duty - helped lead to a not-guilty verdict in the ex-cop's DUI case yesterday.

And now the former cop, William Haviland, who completed a program for first-time offenders after another DUI arrest in 2008, will try to get his old job back.

Haviland, 43, had been an officer for seven years when he was arrested several days after leaving a Tacony bar in his squad car on Nov. 7, 2010. He left court yesterday a smiling, free man.

His was one of more than 2,000 DUI cases from September 2009 to November 2010 that have been affected by the discovery of four inaccurately calibrated Breathalyzer machines at police headquarters.

Several prosecution witnesses testified that Haviland had been drinking that night, but Breathalyzer results showing that he was legally drunk were not presented as evidence because of the calibration problems, said Assistant District Attorney Irina Ehrlich.

"It's outrageous that a police officer in uniform can be driving a city-issued vehicle and drinking on duty," she fumed after the trial.

"You can prove that the man drank; that's on the record," Common Pleas Judge Roger F. Gordon said, while announcing his verdict after the one-day, nonjury trial.

But he reasoned that Haviland - who did not testify - demonstrated that he was not driving drunk when he drove down narrow Flora Street without losing a side mirror or causing an accident on his way to the 26th District headquarters, in Fishtown.

"That was a sobriety test," Gordon said.

"He made bad choices but he operated the vehicle safely," defense attorney Joseph Kelly said after the trial.

Ehrlich argued that Haviland was clearly drunk at the Tacony bar when he was supposed to be patrolling the parking lot of the SugarHouse Casino in his district.

A Hispanic couple who was at the bar, Jose and Dawn Borges, testified that Haviland appeared drunk and belligerent, and that he used racial slurs before Jose Borges used his cellphone to call 9-1-1.

Two of Haviland's supervisors, Sgt. Michael Lorusso and Sgt. James Boone, testified that when Haviland returned to the station that night, he smelled of alcohol and admitted that he'd been drinking shots and beers.

Ehrlich, however, couldn't use Haviland's 2008 DUI arrest in Bucks County because the officer chose not to testify. That charge was expunged after he completed the Accelerated Rehabilitative Disposition program.

Defense attorney Kelly denied that Haviland had made racial slurs at the bar or that he had told his supervisors that he'd been drinking. He conceded that his client had gone to the bar because of recent news that his mother had been diagnosed with cancer.

"He was upset and he went to see his uncle at the bar," Kelly said. "That's what happened."

Fraternal Order of Police President John McNesby said that the process of getting Haviland reinstated will begin automatically.

"We will ask that he be reinstated," McNesby said. "The reason being is that the grievance is filed in our name, not his. So, we have no recourse but to seek getting his job back."