John Hoffman had been assaulted, run over, kidnapped and dragged by fleeing cabs since becoming Montgomery County's first taxicab inspector in 2000.

Nicknamed by some the "Dirty Harry of Taxicab Inspectors," Hoffman went undercover as a clueless tourist, set up sting operations and investigated problems ranging from sexual assaults to cabbies who didn't show up on time.

But Hoffman resigned in protest two weeks ago following repeated clashes with county leaders over his tactics for ferreting out unscrupulous and illegal taxi drivers, many of whom had come to fear him.

"It was getting more and more difficult to do my job," said Hoffman, 62, a retired police officer. "My feeling is they were trying to obstruct me in doing my job. . . . You either stand up for what you believe in or you quit."

Hoffman's departure, which comes as Montgomery is trying to beef up its inspection and enforcement of its 580 licensed taxis, stems from a broad dispute over how best to enforce the taxi code.

While police departments in many Virginia counties are charged with inspecting taxis, in Montgomery the job falls to a civilian. Hoffman, however, was never quite able to give up his old policing habits, and county officials all but branded him a renegade inspector.

"Mr. Hoffman's heart was in the right place, but he often crossed the line in the execution of his duties, putting himself and others at risk," county spokeswoman Esther Bowring said.

Over the years, Hoffman employed a number of controversial approaches to ensure that county laws governing taxis and their drivers were adhered to.

In 2000, Hoffman asked a pilot friend to fly over the headquarters of the county's dominant taxicab provider, Barwood Inc., to photograph its parking lot and gather evidence for a case.

In December 2004, his superiors were surprised to learn that Hoffman had started an investigation into allegations of Medicaid fraud dealing with taxi service, a probe officials say is far outside the realm of a taxi inspector's normal duties.

Last year, a limousine hit Hoffman after he refused to move from its path while he was writing the driver a citation. It was the second time he had been struck while standing in front of a cab or limousine to prevent it from moving.

The incident caused superiors to order him to "cease and desist in certain types of aggressive enforcement," according to personnel records supplied by Hoffman.

Hoffman, who was Chevy Chase Village's assistant police chief from 1990 until 1997, got into trouble again last month after he received a tip that a driver was selling drugs from his cab.

On May 14, unbeknownst to police or other county officials, Hoffman confronted the driver, who he said tried to flee on foot. Hoffman said he searched the cab and found "numerous plastic bags and packs of cigars he was loading up for blunts."

His actions didn't sit too well with his superiors, who said he should have left the matter to the police. He was reassigned to a desk job May 27 for violating the earlier order to avoid certain enforcement actions, according to the personnel documents.

Hoffman, who has been an outspoken critic of what he sees as a cozy relationship between county leaders and Barwood Inc. owner Lee Barnes, said he was doing what any good investigator would do.

"The cab code says you can't have drugs in their cabs, and I enforce the cab code," he said.

Hoffman's direct supervisor, Nancy Kutz, said she is not allowed to discuss personnel matters. But the taxi inspector "is not supposed to be a police officer," she said.

Rules and regulations are outlined in Montgomery's taxi code, such as the licensing of drivers and the requirement that all drivers maintain manifests, or passenger logs. Because of lax enforcement, the county hired Hoffman in 2000. The inspector can issue civil citations of up to $500 to drivers as well as recommend license revocations.

In the past three years, Hoffman wrote about 1,200 citations. This year, County Executive Douglas M. Duncan (D) sent him a letter praising his work ethic.

Hoffman resigned May 31, four days after being ordered to take a desk job, because he said the county wasn't committing the resources he needed to do his job.

After he was run over in 2000, Hoffman requested a radio that would allow him to communicate with police. He said the request was not granted.

In 2003, Hoffman instead relied on his cell phone to call police after he said he was kidnapped while trying to issue a citation to a driver in Montgomery who was licensed in the District. Instead of stopping the cab, Hoffman said, the driver raced at speeds reaching 68 mph toward the District, where the inspector would not have power.

Hoffman said he had pleaded unsuccessfully with officials to allow county police officers to assist him in enforcement and undercover operations. "They kept sending me out to do a job but never gave me the assistance, the coordination or the backing of the police," he said.

Last fall, the County Council and Duncan agreed to amend the county's taxicab regulations to increase competition and improve service. The changes included adding funds to hire a second taxicab inspector. Today, the county will begin soliciting applications for both positions.

Hoffman said he has been told that the county won't be hiring any more former police officers as taxi inspectors.

Ex-taxi inspector John Hoffman says he never received "the assistance, the coordination or the backing of the police."