Andy Murray's mother, Judy, has spoken in detail for the first time about how narrowly the Wimbledon champion escaped the Dunblane massacre at his school, describing the shooting as a "dark, tragic time" for the family's home town.

Sixteen children were murdered along with their teacher on 13 March 1996 when Thomas Hamilton broke into the gymnasium of Dunblane primary school armed with four handguns and 700 rounds of ammunition and began shooting at a class of five- and six-year-olds. The young Murray, then eight, and his brother Jamie, two years older, were in the school at the time.

"Andy's class had been on their way to the gym," Judy Murray told the Radio Times. "That's how close he was to what happened. They heard the noise and someone went ahead to investigate. They came back and told all the kids to go to the headmaster's study and the deputy head's study.

"They were told to sit down below the windows, and they were singing songs. The teachers and dinner ladies did an amazing job, containing all these children, feeding them, and getting them out without them being aware of what had happened. I don't know how they managed it."

Jamie, she said, had been in a prefab classroom when the shooting began. "He told me they thought someone was knocking on the roof with a hammer. They could hear the noise, but you'd never think of gunfire."

She first heard about the shooting while at work in the family toy shop in the Scottish town, she said, at which point she picked up her car keys and ran. "I was driving there thinking I might not see my children again. There were too many cars on the road – everyone was trying to get there. I got angry, shouting 'Get out of the way!' About a quarter of a mile away I just got out and ran."

She arrived at the school gates, which were closed, to join a group of other parents. "People weren't frantic. They were shocked, quiet. It was before mobile phones. Nobody knew anything."

The families were moved to a classroom and told to wait, the 54-year-old said, packed in so tightly that she was sharing a chair with a woman she had been to school with. Eventually a policeman came and asked the parents of one particular class to leave with him.

"The girl sharing my chair said 'That's my daughter's class.' I don't know if I have survivor's guilt, but I had an awful moment then when I was so relieved it wasn't my kids, and then felt terrible. She lost her daughter."

Murray said she couldn't remember the moment when she saw her sons again, but "on the drive home I knew I had to stop the car to tell Jamie and Andy what had happened – they didn't know, and it was clearly going to be everywhere. It was an impossible thing to explain to children. I'm very glad they were too young to understand the enormity of it."

Both Andy and Jamie, who won the Wimbledon mixed doubles championship in 2007, had known Hamilton as children. "They had been to boys' clubs he ran locally at the high school," their mother said. "I knew him too – I'd given him lifts from the boys' clubs to the station. He was a bit of an odd bod, but I wouldn't have thought he was dangerous. So he'd been in my car."

The world tennis number five, who next week will begin his defence of his Wimbledon title, broke down in tears last year when asked about his memories of the murders for a BBC documentary, saying that as a child "you have no idea how tough something like that is, and then as you start to get older, you realise … It wasn't until a few years ago I started to research it and look into it a lot, because I didn't really want to know."

He has previously spoken about remembering only "patch impressions" from that day, "such as being in a classroom singing songs". Of his sporting success, he said that "it's just nice I've been able to do something that the town is proud of". He has since bought and renovated a luxury hotel in Dunblane, saying he was pleased to be able to "give something back to the community I grew up in".

"The only time I get emotional about Jamie and Andy's Wimbledon wins is when I'm in Dunblane," Judy Murray said in her interview. "When you've gone through a really dark, tragic time, and then come to a real high, I hope it helps people to feel something really positive about that town … What it definitely does is make you appreciate what you've got."

Murray, herself an elite tennis coach who is captain of the British Federation's Cup team, hit back at criticism of herself as a "dragon" mother. "I think if I were the dad of sons, I wouldn't have been noticed. There's something about a competitive mum, especially when the children are male.

"I have my own life and I'm always busy. If I want to see my children, watching them play is often the easiest way. I don't smile when I watch Andy because I'm totally focused. If he looks up, he doesn't want to see me laughing."