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 today.

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, was a seven-year police veteran when he was arrested several days after leaving a Tacony bar in his squad car on Nov. 7, 2010. He left court today a smiling, free man.

His was one of more than 2,000 DUI cases from September 2009 to November 2010 that have been impacted 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 that showed he was legally drunk were not presented as evidence due to 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 Court 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 bar in the 15th District 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 Mr. 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 a 2008 DUI arrest in Bucks County against Haviland because he chose not to testify. That charge was expunged after Haviland completed the Accelerated Rehabilitative Disposition program.

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

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

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

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