The Osaka District Court ruled Wednesday that a city ordinance banning labor unions from using public facilities such as school buildings for meetings was illegal and unconstitutional, ordering the city to pay a union around ¥417,000 in compensation.

The ruling is a defeat for the strongly anti-union Osaka Mayor Toru Hashimoto, who supported the 2012 ordinance.

The mayor, his Osaka Ishin no Kai (One Osaka) party, and their conservative corporate backers, many of whom favor the privatization of Osaka's public schools, have long battled against the teachers' union.