Last weekend, a friend decamped from tokyo to the chiba seaside, liberally punctuated the afternoon with cocktails and, by nightfall, had mustered the necessary courage to get her arm tattooed.

The result a demure constellation of black dots on her inner wrist is chic but unremarkable. the newly-defined legal environment in which this act of artistry took place, however, is extraordinary: a quietly pivotal moment for japan and a reminder of how robustly the constitution can swing into action when required.

For the tattooist who be-dotted my friends arm, along with several thousand other professionals around the country, was at last unquestionably working on the right side of the law for the first time in more than 70 years. as of september 16, she has plied her trade with a needle in one hand, ink-bottle in the other and a landmark supreme court judgment at her lavishly decorated back. the route that brought japan here reveals a critical line overstepped by police. the judgment itself, involving an admirably common sense interpretation of the law, provides a glimpse of what sits atop a criminal justice system often cast as a crude conduit for prosecution.

The saga began in 2015, when the osaka police (for reasons never properly explained, but which lawyers said came under the general heading of ijime bullying) swooped on dozens of tattoo parlours. the justification for the arrests was that none of these tattoo artists operated with a full medical licence: a true accusation (it takes at least six years to get one in japan and most holders become doctors rather than tattoo artists), but whose pertinence had never been tested.

By doing so, the police stomped into a legal grey zone in which everyone presumed the prosecutors would prevail. tattooing in japan, though long associated with the criminal underworld, was never explicitly outlawed. but the social stigma attached to tattoos is visceral and the medical practitioners act, with its 150-year-old origins, had always seemed the ideal cudgel with which to beat the industry, should the need arise. the medical act of penetrating the skin, police would argue, is covered by the licence requirement. tattooing without one could theoretically land the needle-wielder in jail for three years.

Until 2015, the law had never been used to prosecute tattooists. most of those arrested in the osaka sweep had no desire to test the courts, so they paid the fines and closed shop. but taiki masuda, a tattoo artist who was 28 at the time, stood his ground. the police, he said, were trying to criminalise a matter of taste and, worse, were doing so in breach of constitutional guarantees of freedom of expression, the right to pursue happiness and perhaps most critically freedom of occupation. with surprising speed, mr masuda found himself supported by phalanxes of criminal lawyers, labour groups, constitutional experts, givers and receivers of tattoos, and prominent academics.

Mr masuda was convicted at the osaka district court but, in a surprise victory for his now substantial team, had the decision reversed at the high court. the prosecutors appealed and the case reached the supreme court, where the chief justices had by now realised there was a great deal more than tattoos at stake. ear piercings and other cosmetic procedures had also fallen under the medical law, as had several comparatively simple procedures associated with care of the elderly. after months of deliberation, the supreme court upheld the high court decision and issued a statement clarifying how japan would now interpret the term medical act.

Whether or not a certain procedure falls under the medical law, the court declared, should be judged by how it is performed, its effect and also by social standards considering its purpose, its receiver and public attitudes. since tattoo artists, in the eyes of the public, do not perform a medical act, it is not one.

A tattoo, remarked one academic lawyer who has followed the case and believes the supreme court has, in effect, declared the primacy of the right to occupation, lasts a lifetime. a judgment of this importance could last even longer.