A court ruled Wednesday that the Osaka municipal office’s 2012 investigation into whether its workers had tattoos was illegal for privacy reasons and invalidated its punishment of a plaintiff who refused to submit a required document.

In a lawsuit filed by Tadasu Yasuda, a 56-year-old worker in the municipal government’s transportation division, the Osaka District Court also invalidated his transfer to a different job after the court action and ordered the city to pay him ¥1.1 million in compensation.

“Whether people have a tattoo or not falls into the category of information carrying a risk of causing discrimination, collection of which is prohibited under a city ordinance for the protection of privacy,” presiding Judge Kenji Nakagaito said in ruling the investigation illegal.

On the instruction of Osaka Mayor Toru Hashimoto, in May 2012 the municipality asked about 33,000 employees if they had any tattoos, requiring them to reply in writing regarding visible body areas such as the hands and neck, and on a voluntary basis for other areas, following an incident in which a municipal worker showed his tattoo to children at a welfare facility.

The plaintiff had his boss confirm that he did not have a tattoo, but did not submit the document to the municipality and received a reprimand in August 2012. After going to the court in October, he was urged by his boss to drop the suit but refused, and then was transferred to a desk job from being a bus driver.

“The judge recognized the investigation was wrong,” Yasuda told a press conference after the ruling. “My colleagues have supported me. It would be best if I can resume working as a driver.”

He also stressed the need to resist such checks into personal matters.

The investigation resulted in 114 employees reporting their tattoos and six refusing to respond.

The municipal government has been checking for the presence of tattoos on visible body areas when recruiting new hires since fiscal 2013.