The working day has barely begun in the special wing of Onomichi prison, but the dozens of inmates hunched over rows of desks on a rain-sodden weekday morning are already starting to wilt.

Their jobs hardly constitute hard labour: constructing corrugated casings for lightbulbs, tying lengths of wire to luggage tags and making pairs of knitted slippers. The silence is broken only when another guard, peaked cap pulled tightly over his eyes, enters the room, salutes and barks a military-style greeting to a colleague.

For these prisoners, the show of authority seems as out of place as the forbidding walls that block the view of the foggy coastline a few miles away. Few, if any, have the energy to start a riot, let alone attempt to escape.

There may be no hardened yakuza gangsters here, but Onomichi's 70 or so ageing inmates nonetheless represent the biggest challenge facing Japan's criminal justice system in decades. While other developed countries debate what to do about youth offenders, Japan is grappling with a different kind of crime wave, and one that demographic trends show can only get worse.

The over 60s are the fastest-growing group of criminals in Japan, which incarcerates its pensioners at a rate far higher than any other country in the industrialised world. The number of Japanese aged 70 and over charged with crimes trebled between 2000 and 2006, from 9,478 to 28,892, according to the national police agency.

Last year elderly men and women were responsible for almost one in seven recorded crimes, compared with one in 25 a decade earlier. While most were guilty of theft, shoplifting and other petty offences, more than 150 were charged with murder.

For the first time, ageing criminals account for more than 12% of the total prison population, prompting the government to earmark 8.3bn yen (£39m) this year to build three new prison wards that will house more than 1,000 elderly inmates.

In the years to come, many of Japan's 74 prisons will end up looking like Onomichi, an ageing prison about 400 miles south-west of Tokyo that first started catering to older prisoners 20 years ago. The prison, tucked away on a hill overlooking the Seto inland sea, incarcerates just over 300 offenders, 76 of whom are 65 or over. The average age of the men in the special ward is almost 70; the oldest is 89.

Almost all are serving sentences of one to several years for theft - usually of food from supermarkets - small-time fraud and, in a few cases, possession of drugs. The most serious offender, a man in his 70s, is serving a 10-year sentence for murder.

Almost all of Onomichi's elderly inmates have their own cell, a 3.6-metre room with tatami-mat floor, a TV, a desk, a sink and a toilet. Their personal effects, mainly books and comics, are stored in locked suitcases whenever they are not in their cells.

Charts on their cell doors stipulate special dietary requirements and medication regimes. A handrail runs the length of the corridor, and makeshift wheelchair ramps are kept at the entrance to the communal baths.

But the most common condition afflicting these men is loneliness. Some serve their sentences without seeing a single visitor. Their relatives are either dead, live too far away or, unable to cope with the shame of having a criminal in their midst, have ceased all contact.

"When one of those inmates dies, the prison discreetly arranges a cremation and sends the ashes to his closest relatives," Tomohiko Ogawa, the chief warden at Onomichi, says during a tour of the prison. "When we did a survey of prisoners due to be released, half said they were happy, not because they were regaining their freedom but because they had someone waiting for them on the outside. Not all of them are so lucky."

The rise of the superannuated criminal is only partly explained by Japan's rapidly ageing population. While the number of Japanese aged 60 and over grew by 17% between 2000 and 2006, the number of prisoners in the same age bracket soared by 87%.

Criminologists blame record levels of poverty among pensioners, the breakdown of the extended family, and a lack of professional help for those with depression and other mental illnesses.

Life on the outside can be unforgiving for elderly men with a criminal record. "Those without family or friends are worst off," Ogawa says. "If they don't have a guarantor, they can't find a place to live. If they have nowhere to live they can't get a job. It's a vicious circle."

Instead, the best chance many have of security, decent healthcare and three meals a day is another stint behind bars. According to a recent justice ministry study, almost two-thirds of Onomichi's older inmates will walk back through its doors within five years of their release.

"I'm comfortable with prison life," a 76-year-old inmate told a Japanese newspaper earlier this year, before the prison banned prisoners from talking to visiting journalists. "I have clothing, food and housing and I'm taken care of when I get sick. Prison life is like a strict nursing home."

Ogawa admits that Onomichi's 76 prison staff face a daily struggle to reconcile society's demands for retribution with their duty of care to inmates. "The prisoners' health is our biggest worry, and what they are going to do when they get out," he says. "But while they are here we have to be seen to enforcing discipline and punishing them for their crimes. If we didn't, people would rightly ask what their taxes were being spent on."

The prisoners repay their debt by performing six hours a day of light manual labour, two less than Onomichi's younger prisoners. Every few minutes, one of the men lays down his tools and shuffles to a makeshift pharmacy set up in the corner of the room, where the prison doctor dispenses pills that must be washed down on the spot with tiny cups of water.

As many as 80% of the inmates here have high blood pressure or diabetes. There is a portable mattress on hand in case anyone feels faint, along with a wheelchair and, placed discreetly behind a desk, boxes of incontinence pads.

Later, in the gymnasium, the noise level rises as the prisoners play table tennis, chat over games of chess or belt out classic karaoke tunes. Others sit and stare, read sports tabloids or flick through a meagre selection of religious and self-help texts.

One inmate in his late 60s who has seven months of his sentence left folds up his Buddhist newspaper and briefly breaks the prison's gagging order. "We are well looked after here," he says. And what is he looking forward to most of all once he gets out? Seeing his family, perhaps? "No ... I can't wait to have a drink and a smoke," he confides, before a guard appears and he goes back to his newspaper.

Backstory

In 2006 Japan's prison population stood at about 80,000, of whom 12% were at least 60. About 1,000 prisoners have difficulty walking, feeding themselves or doing prison work. Many more have long-term but manageable health conditions. Of the 46,637 people over 60 convicted in 2006, just over half were found guilty of shoplifting, followed by 23% who had committed petty theft. While the number of charges against juveniles increased by 2% from 2000-04, there was a 125% increase among over-70s. Last year there were 152 murders by over-65s, including a 65-year-old woman who strangled her sick husband after "he repeatedly shouted at me over many years". Japan is far ahead of other countries in locking up elderly people. According to the latest figures available, 2.8% of prisoners in the UK are in the same age bracket, while in the US 1.8% of prisoners are over 60.

· Sources: Justice ministry; national police agency; National Institute of Population and Social Security Research; Penal Reform Trust; US bureau of justice