“I feel like this is the end for me,” said Andy Murray as tears welled in his eyes. “My body just doesn’t want to do it any more and my mind doesn’t want to push through the pain barrier any more. I was just hoping I was gonna feel better than this after 16, 17 months. It’s just an emotional night because I’m coming to an end.”

He was speaking in his documentary, Andy Murray: Resurfacing, which premieres on Friday 29 November on Amazon Prime. At that moment last August he had just completed a delirious three-set victory over Marius Copil at 3am before sitting in his chair and sobbing loudly into his towel. As the world attempted to decipher whether his tears were born out of the joy of a third consecutive three-set win on his raging hip or a reflection of something more heartbreaking, a distressed Murray retreated to his hotel room and he spoke to his own camera from under the covers of his bed. He fought back tears as he contemplated the end of his career.

The documentary started as a simple behind-the-scenes view of his recovery from injury in 2018 but it has snowballed into one of the great tennis comebacks. It is in these intimate moments, often not captured by a professional camera, that it thrives.

Murray, 32, has talked exhaustively about how close his career came to ending after struggling to find a resolution to his hip but it is striking to see him speak with such resigned finality.

“You open up as it goes along and feel more comfortable talking about your issues and how you are feeling. And then obviously as the documentary gets closer, you realise at the time that you are really vulnerable. I don’t like watching myself on camera for a start. Also, seeing myself like that is difficult at times,” said Murray on Monday.

Andy Murray: Resurfacing, the Amazon Prime documentary, tells the story of his battle to regain fitness following surgery. Photograph: Amazon Prime Video

The film follows Murray from his first surgery in January 2018 and his attempt to return to the court a year later. There are numerous times when he believed his career was over and distressed by his seemingly impending retirement Murray re-evaluated every aspect of his career. He frequently expressed his fear of a life without the structure that his career has provided.

The quietest moment of the documentary proved the most powerful. The director, Olivia Cappuccini, the fiancée of Murray’s brother-in-law, Scott Sears, had spent much of their time trying to understand why tennis was so important to Murray. It was not until last December that he finally sent her a simple voice note with his response:

“Dunblane happened when I was nine,” Murray said. “We knew the guy. Twelve months after, our parents got divorced. That was a difficult time. And then my brother moved away from home shortly after. We did everything together, so that was quite hard for me. For a year or so I had lots of anxiety but that came out when I was playing tennis.

“Tennis is an escape for me in some ways. All of these things are bottled up. We don’t talk about these things. I show my personality on court. Tennis allows me to be that child. That’s why it is important to me.”

Murray has very rarely discussed such a traumatic part of his childhood and few people have asked. On Monday he said he refused to open up about it for a long time.

“As things were getting worse and stuff, it started to look like it was coming towards the end of playing. I was trying to explain why this was so difficult for me. I guess she was trying to understand why. She was there with us in Miami and I was like: ‘Look, I am not talking to you about this to your face.’ One, I feel a bit embarrassed about it. And two, I have not really spoken to anyone that much about it ever. So, that was kind of how that came about.”

Watch the trailer for Andy Murray: Resurfacing.

Before he announced his career seemed to be coming to an end at the Australian Open this year, Murray frantically agonised over whether he was making the right decision by speaking out. It was only after he told the world that he was able to relax and enjoy what could have been the final tournament of his career.

During one of his final training sessions before his defeat by Roberto Bautista Agut in the first round, he thought back to old matches in Melbourne: “Forty-eight matches I won here in Australia. It would be quite nice to get to 50,” he said. He did not then.

The greatest triumph of his career is that he will return to Australia in January with hope renewed.