Ukraine said on Thursday it had detained a member of the national guard suspected of opening fire at a factory in the centre of the country and killing five people.
The shooting took place in the city of Dnipro when a gunman opened fire with a Kalashnikov assault rifle and immediately fled the scene, the interior ministry said.
Four members of the national guard and a civilian woman were left dead.
The shooting comes at time of heightened alert in Ukraine over the conflict with separatists in the east of the country.
The suspect "has been detained by police", Interior Minister Denys Monastyrsky said on Facebook, after the serviceman was reported to have fled the scene in possession of a weapon.
Monastyrsky added that five people were injured in shooting early Thursday and that "doctors are fighting to save their lives."
"Following my order, a commission will be set up to study the circumstances that led to these actions being taken by a 21-year-old soldier, who had been called to defend his country and be responsible for security -- and not to shoot his colleagues," said Monastyrsky.
The incident occurred at around 3:40 am local time (0140 GMT), at the beginning of the suspect's shift, when he was being issued a weapon.
Police said he had been detained in the town of Pidgorodne outside Dnipro, a city with an estimated population of around one million people.
The Yuzhmash facility is an aerospace factory that produces and tests materials related to defence, aeronautics and agriculture.
The ministry published images of the shooter with a shaved head and in military uniform, identifying him as Artemy Ryabchuk, born in 2001 in the southern region of Odessa.
It said earlier it was studying the motives for the shooting and announced that the commander of the national guard, Mykola Balan, had been dispatched to the scene.
Monastyrsky said there would be an investigation into how Ryabchuk has passed military medical examinations and had been sanctioned to carry a weapon. (AFP)