The suspect in the deadly school shooting in the Russian city of Kazan was on Wednesday charged with multiple counts of murder.
Nine people, including seven students, died in Tuesday's shooting at School No 175 in the Tatarstan Republic.
The attacker, identified as 19-year-old Ilnaz Galyaviyev, was placed in pre-trial detention for two months.
The authorities gave no immediate details on the suspect's motive, but confirmed that he legally owned a firearm.
Galiaviev, a former student of the school, listened to the court's decision calmly without answering questions from the press, before being led out of the courtroom.
Dressed all in black and handcuffed in his glass cage, he was accompanied by several guards and complied with the orders of the judge to present himself, stand up or sit down.
The gunman had a "short temper", authorities say
Deputy Prosecutor of Tatarstan Aleksey Zaika told journalists after the hearing that Galyaviyev's health conditions were not obstacles to pre-trial detention. He also added that forensic psychiatric assessment will be conducted.
Investigative Committee spokesperson Svetlana Petrenko said the suspect complained last year of severe headaches and was diagnosed at one of the regional clinics with a brain disorder.
It added in a statement that his family noted he had been exhibiting a "short temper" and "aggressiveness" since the beginning of the year.
According to media reports, Galyaviyev was expelled from a vocational school in April after not showing up for classes and exams for weeks.
Funerals for the victims were also held on Wednesday, which was a day of mourning in the predominantly Muslim republic of Tatarstan.
At the funeral of Elvira Ignatyeva, a 26-year-old English teacher, relatives and friends hugged each other and cried as she was laid to rest.
“She loved children,” said her uncle, Talgat Gumerov, speaking to reporters in a quavering voice after the burial, which was carried out the day after her death in accordance with Islamic tradition.
Twenty-three people remained hospitalised from the attack on Wednesday. Three wounded children remain in grave condition, Health Minister Mikhail Murashko has said.
Shooting has "shaken" Russia, says Putin
Russian President Vladimir Putin on Thursday said that the deadly school shooting in Kazan "has shaken" the country and ordered the government to revise school security protocols and tighten civilian gun laws.
"The tragedy has definitely shaken all of us," Putin said, speaking at a meeting with government officials via video link.
"All of Russia... stands with Tatarstan, with Kazan residents, in the difficult days."
Putin has ordered the head of the country’s National Guard to "seriously raise the requirements for civilian gun owners".
The president also said that the tragedy in Kazan highlighted problems with school security, and tasked the government with introducing a unified security and anti-terror protocol.
The deadliest school attack in Russia took place in 2004 in the city of Beslan, when Islamic militants took more than 1,000 people hostage for several days. The siege ended in gunfire and explosions, leaving 334 dead, more than half of them children.
In 2018, a teenager killed 20 people at his vocational school before killing himself in the Crimean city of Kerch. In the wake of that attack, Putin had also ordered authorities to tighten control over gun ownership.
Some Russian lawmakers are also calling for more restrictions on the internet, after revelations that the gunman in Kazan had posted on the messaging app, Telegram, before carrying out the attack.
But Telegram founder Pavel Durov said Galyaviyev made his account about the attack open to the public only 15 minutes before it happened, and his posts were too vague to act on.
"The inevitability of such events doesn't make them less tragic," Durov wrote on his account.
"But they should not serve as a pretext for organizing a witch hunt or turning the society into a concentration camp."