A South Korean man who detonated a homemade device in a public restroom at a controversial shrine in Tokyo has been sentenced to four years in prison.

Jeon Chang-han was sentenced Tuesday in Tokyo District Court. He was arrested in December and charged with trespassing, property damage and violation of the explosives control law.

No one was hurt when the explosion took place at Yasukuni Shrine on Nov. 23.

The shrine has been subjected to intense criticism by South Korea and China, both of which lambast the shrine for enshrining war criminals among 2.5 million Japanese war dead.