media captionVideo shows students escaping from school windows

Outside School No 175 you can see signs of the tragedy that unfolded here.

Police and criminal investigators roam the courtyard. Ambulances remain parked up.

Then there's the makeshift shrine set up by the school gates. People have been flooding here from across the Russian city of Kazan – the capital of the republic of Tatarstan – to lay flowers, leave soft toys and light candles in memory of the victims of Tuesday's school shooting.

image source, Reutersimage captionPeople have been leaving flowers and soft toys at a makeshift memorial for victims of the deadly shooting in Kazan

What happened here has shocked not only this city, but the whole country. A day of learning had turned into a day of bloodshed.

Earlier, a 19-year-old former student of the school had returned with one aim: to kill. He gunned down students and staff.

"At first I heard gunshots. Then there was an explosion," says Max Zaretsky, who lives opposite the school.

"After that there was screaming. Children were running to the fence. 'Oh my God. They're killing us!' one little girl screamed. That was the moment I realised it wasn't an accident and that something horrible had happened."

image source, Reutersimage captionPeople gather to lay flowers at a site outside the representative office of the republic of Tatarstan in Moscow

Inside School No 175 there was panic. To escape, some children jumped out of windows. Others, like 10th grader Alisa Zobleva, barricaded themselves into classrooms.

"We shut the doors and we froze," Alisa tells me. "Then we had minutes of stress and panic. Someone knocked on the door. We thought it was the man with the gun. Ten minutes later there was another knock. [The police] broke down the door and we were rescued."

One parent, Irina, whose daughter was at the school, says she received a text message from inside.

"It read: 'I love you, Mum.' I telephoned another parent to find out what was going on. We didn't know. But smoke was rising from the school."

Irina's daughter was unhurt.

image source, EPAimage captionThe deadly school shooting has shocked the nation

The attacker was eventually taken into custody. Russian media have named him as Ilnaz Galyaviev. Under interrogation he reportedly said he had come to believe that he was God and indicated he had been driven by hatred.

Near the shrine of flowers and candles, I get talking to Iskander. He knew Ilnaz Galyaviev. They had studied together in the school. Iskander can't believe what has happened.

"He was a really quiet guy when I knew him," he says. "Really calm."

Kazan is struggling to come to terms with this tragedy – the question you hear people asking most here is: Why?