A 27-year-old man who sparked a nationwide media frenzy this spring during his three-week escape from a prison in western Japan received a four-year sentence on Friday.

The Matsuyama District Court ruled that Tatsuma Hirao serve the jail term for fleeing an open prison in Imabari, Ehime Prefecture, around 6 p.m. on April 8 and stealing about 30,000 yen ($260) in cash, a car, a minibike and some 60 other items worth a total of 310,000 yen, until police caught him in Hiroshima on April 30.

Hirao's evasion from a massive police manhunt, before his capture in the city about 100 kilometers from the prison, included swimming across the sea from the tiny island of Mukaishima to Japan's main island of Honshu.

On the main island, he hid in the attic of a house without being noticed by its residents for five days.

Presiding Judge Yoichi Suehiro said, "His behavior was malicious in that it ignored the purpose of open-type imprisonment, which is based on relations of trust with prison officials."

The judge said his main reason for escaping was that he thought he would be ousted from his post as a member of an in-house safety commission for violating prison rules, and wanted to break away from his relationships with others at the facility.

Hirano admitted to the charges during his trail, at which prosecutors had sought a six-year prison term.

Hirao had been serving a term at the open prison until January 2020 for theft and other crimes. He is now expected to serve the remaining 17 months plus another four years.

Following his escape, Matsuyama Prison's Oi shipyard decided to take preventive steps including carefully selecting inmates deemed suitable to stay at the rare open-type facility by taking into account the views of expert psychologists.

The prison previously had a self-governing body consisting of inmates chosen by prison officials that would lead various activities, but it also scrapped the system, deeming it had created a hierarchy among inmates.