An inmate who fled an Ehime Prefecture prison in April was driven to escape due to relationship problems, prosecutors claimed at the case's first court hearing on Friday.

Tatsuma Hirao, 27, was indicted for allegedly stealing a car and cash after escaping from a minimum security prison in the city of Imabari. He was caught in the city of Hiroshima following a three-week manhunt. He has admitted to the charges.

According to the prosecutors, Hirao felt he "had no place in prison," after he violated rules and was told by a prison guard he would be ousted from his post as a member of an in-house safety commission. He wanted to be free from relationships at the prison and left a letter of apology in his shoe box before fleeing, they said.

After escaping from Matsuyama Prison's Oi shipyard, a rare open-type prison facility, Hirao eluded a massive police search involving tens of thousands of personnel for three weeks. According to the indictment, Hirao escaped at around 6 p.m. on April 8 through a window on the facility's first floor. He stole about ¥30,000 ($270), a car and about 60 other items, including a minibike and an identification card — worth around ¥310,000 in total — in Imabari and Onomichi, Hiroshima Prefecture.

He drove a stolen car from Ehime to the island of Mukaishima in the city of Onomichi and hid in a cottage there. He later swam across the sea from Mukaishima to the main island of Honshu before being caught in the city of Hiroshima on April 30.

Hirao has told police he escaped because it was difficult to remain at the prison, reportedly telling them he was "disgusted with relationships." He was serving time at the prison until January 2020 for crimes including theft.