MOSCOW — At least 17 people, mostly teenagers, were killed and 50 others were wounded Wednesday when a student went on a shooting rampage at his high school in Russian-annexed Crimea, Russian authorities said.

Russian investigators identified the gunman as 18-year-old Vladislav Roslyakov. They said he fatally shot himself after the attack in Kerch, a city in eastern Crimea. Russia seized the Crimea region from Ukraine four years ago. 

Initial reports described the attack as involving explosives, with possibly terrorist motives.

Russian investigators opened a terrorism probe into the attack, but later changed it to a murder case.

“A preliminary examination of the dead shows they suffered from gunshot wounds,” Russia’s investigative committee said in a statement. “The majority of them are teenagers.” 

There were conflicting reports about what took place. Russia’s anti-terrorism committee initially said an explosive device was to blame for the attack on the vocational high school, attended by adolescents between the ages of 15 and 19. It said a bomb was planted in the cafeteria. 

President Vladi­mir Putin expressed his condolences to the families of victims. “It is clear that a crime took place. The motives and scenarios of this tragedy are being studied,” he said at a meeting with Egyptian President Abdel Fatah al-Sissi in the Black Sea city of Sochi. He then asked for a moment’s silence. 

Russian media released a photograph of Roslyakov showing him with shorn blond hair and combination of black pants and a white T-shirt. His garb drew comparisons to one of the two gunmen in the 1999 Columbine High School massacre, who wore a similar outfit. Roslyakov was pictured holding an automatic rifle. 

The Russian news service Mash described Roslyakov as an introverted loner with a fondness for “maniacs.” He purchased an automatic rifle and cartridges last week, his classmates were quoted as saying. 

As the wounded poured into a local clinic, the attacker’s mother, a nurse named Galina Roslyakova, attended to them, Mash reported. She was later called away to meet with investigators. 

Russia has relatively strict gun laws, and such mass-casualty shootings are rare. In recent years, several incidents have been reported in which students launched attacks with axes, knives and air guns. 

Wednesday’s shooting was the first mass-casualty attack on Russian-controlled territory since a suicide bomber killed 16 people on the St. Petersburg metro in April last year. No group claimed responsibility for that attack, but Russian security forces said it was the work of an Islamist radical. 

Natalia Abbakumova contributed to this report.