In a resounding victory for San Jose police, a judge has ruled that every action officers took during a controversial 2011 traffic stop was justified -- stopping a black BMW for playing loud music, arresting the passenger who mouthed off and initially refused to put his hands on the dashboard and zapping him with a stun gun.

The ruling Friday by Judge Beth McGowen comes after Air Force veteran Michael Fujikawa sued the city, claiming his only violation during the downtown traffic stop was of an unwritten rule barring "contempt of cop," the San Jose Mercury reports. His arrest shortly before the bars closed, Fujikawa contended during a six-day trial in Santa Clara County Superior Court, was merely payback for initially refusing to put his hands on the dashboard and mouthing off to Officer Steven Payne Jr.

Fujikawa spent five days in jail on what he claimed were inflated charges, including resisting arrest, battery and attempting to disarm an officer. Prosecutors immediately dropped the disarming allegation and, 11 months later, just before Fujikawa was to stand trial, dismissed the rest of the case.

But in the civil case against police, the judge strongly disagreed with Fujikawa's innocuous description of the incident and his claim that his civil rights were violated, calling his conduct "belligerent." Police had legitimate grounds to believe he was interfering with their investigation of the driver for playing loud music, she ruled, adding that Fujikawa admitted he was drunk and even apologized for his behavior afterward.