Two soldiers were killed and another was wounded when a fellow recruit opened fire at a training range in central Japan, the military has said.
"During a live-bullet exercise as part of new personnel training, one Self-Defense Forces candidate fired at three personnel," the Ground Self-Defense Force (GSDF) said in a statement, confirming two deaths.
The shooter was an 18-year-old SDF candidate who joined the military in April, GSDF chief of staff Yasunori Morishita told reporters, adding he was detained on the spot by other soldiers.
"This kind of incident is absolutely unforgivable for an organisation tasked with handling weapons, and I take it very seriously," he said.
He said the three victims had been tasked with training new recruits, including the attacker, at the range, without further elaborating on their relations.
The suspect has been charged with the attempted murder of a 25-year-old soldier, a local police spokesman told AFP, declining to be identified.
The cadet "fired a rifle at the victim with the intent to kill", the spokesman said.
National broadcaster NHK reported the casualties were a man in his 50s and two other men in their 20s.
Aerial footage broadcast by the station showed military and civilians gathered around an emergency vehicle and police blocking nearby roads.
The training range is administered by the region's Camp Moriyama and is a covered facility of more than 65,000 square metres.
Gun possession is tightly controlled in Japan, where violent crime is rare.
But several high-profile incidents have rattled the country over the last year.
In July 2022, former prime minister Shinzo Abe was shot dead on the campaign trail by a man who allegedly targeted him over his links to the Unification Church.
The accused, Tetsuya Yamagami, was due to make his first appearance in court this week, but the session was cancelled after a package sent to the facility set off a metal detector.
It was later found to contain no explosives, but rather a petition signed by thousands calling for a lenient sentence for Mr Yamagami.
He has garnered surprising sympathy from some quarters over the effect his mother's devotion to the Unification Church had on his family and childhood.
That incident came shortly before Japan hosted the Group of Seven leaders' summit in Hiroshima and prompted renewed calls for stepped-up security.
Thousands of police were deployed to secure the gathering, which passed without a security incident.
Last month, police in the Nagano region west of Tokyo detained a man after an hours-long knife and shooting rampage, followed by an extended stand-off.
The man killed four people, including two police officers, before he was detained. He is reportedly the son of the speaker of the local city assembly.