A member of the Ukrainian National Guard opened fire on fellow soldiers and killed five people, the Interior Ministry said on Thursday.
The attack led to the head of the National Guard tendering his resignation.
Four men and one woman were killed in the shooting, which occurred overnight at a military plant in the south-eastern city of Dnipro, Interior Minister Denys Monastyrskiy wrote on Facebook.
Another five people were injured, he added.
The shooting occurred as weapons were being handed out to the troops.
The 20-year-old conscript attempted to flee, but he was arrested a few hours later.
The serviceman is said to have shot his comrades out of revenge. They are said to have harassed the suspect after he complained about bullying by professional soldiers and other humiliating practices.
Ukrainian National Guard Commander Mykola Balan resigned in the evening, saying he ultimately bore responsibility as a leader, according to media reports.