Reaching world number one in an era of Roger Federer, Novak Djokovic and Rafael Nadal speaks volumes about the drive of Andy Murray, who took up the game as a three-year-old.

But at 31, excruciating pain from a hip injury is drawing the curtain on a professional career that spanned 14 years and ended a decades-long drought for British tennis.

The Scot would prefer to go out in a blaze of glory on home territory at Wimbledon, but may not get that far with next week’s Australian Open shaping as potentially his last event.

His has been a glittering career, but it may have been very different.

In a terrifying twist of fate, an eight-year-old Murray hid himself away during the Dunblane school massacre that claimed the lives of 16 children and one teacher in 1996.

A 43-year-old man with 700 rounds of ammunition opened fire on Murray’s schoolmates before shooting himself in a gymnasium that Murray had been on his way to at the time.

He is a big football fan and could also have gone down that path when offered a trial with Scottish giants Rangers. But he opted for tennis instead, encouraged by his mother Judy, and moved to a renowned academy in Barcelona as a 15-year-old.

There he honed his skills – developing a rare counterpunching style that valued speed, finesse and fitness over raw power – before turning professional in 2005, making five semi-finals in a breakout year

Murray showcased his talent to the world by reaching his first major final at the US Open in 2008, only to lose to the already incomparable Federer, who beat him again in the Australian Open final two years later.

By the time Murray was beaten by the Swiss maestro at Wimbledon in 2012, he feared he would never be able to call himself a Grand Slam champion.

But his remarkable work ethic and intense focus were rewarded during a purple patch under the guidance of demanding coach Ivan Lendl.

In 2012 he emulated legendary Briton Fred Perry’s 1936 achievement by winning the US Open, beating defending champion Djokovic in four hours 54 minutes.

It was the equal-longest final at Flushing Meadows in history, and finally gave Murray the major title he had been craving.

“When I realised I had won, I was a little bit shocked, I was very relieved and I was very emotional,” he later said.

The footsteps of Perry

In another era, another generation less golden – one shorn of epoch-making greats like Federer, Djokovic and Nadal – he may have been all conquering.

Instead, a nagging sense of underachievement shadowed his career.

But that only made his successes all the more sweet – never more so than on the afternoon of July 7, 2013.

When Djokovic’s baseline shot hit the net with a clipped thwack it shattered the tense silence of Wimbledon’s centre court and sent his native country into pandemonium.

An exhausted Murray dropped his racket, shook his fists in the air and broke down on the ground in tears. 6-4, 7-5, 6-4. Victory. The first British man to win Wimbledon for 77 years, ending the nation’s obsession with finding a champion to follow in the footsteps of Perry.

“I didn’t know what to do with myself,” said Murray. “The noise levels during the whole match were just incredible.”

That final was watched by more than 17 million viewers in Britain and, according to the ATP tour, was the most talked about among British Facebook users, outshining the “birth of a future King, appointment of a new Pope and passing of an iconic Prime Minister”.

In 2015, he married his long-term girlfriend Kim Sears, often spotted supporting him from the stands at his tournaments, and the couple now have two children together.

Knighted “Sir Andy”, he is still the only person to be named British sports personality of the year three times. But his relationship with the United Kingdom was not always simple, drawing criticism for backing Scotland’s failed 2014 bid for independence.

When he split with Lendl in the same year, Murray went into a funk that lasted two years.

He began working with former women’s world number one Amelie Mauresmo, winning plaudits as a feminist pioneer in the macho world of men’s tennis, but the relationship yielded no more Grand Slam titles.

But he returned to winning ways in 2016, lining up against big-serving Canadian Milos Raonic in the Wimbledon final after upsetting Federer in the semis, and rallied to a 6-4, 7-6 (7-3), 7-6 (7-2) victory.

He then became the first player to win two Olympic singles gold medals when he successfully defended his title in Rio, defeating Juan Martin del Potro in “one of the hardest matches” of his career.

But the injuries began to take their toll and he pulled out of last year’s Australian Open to have hip surgery. He only returned in June, and all was not well.

The grind of professional tennis had taken its toll and with the pain not going away, Murray has reluctantly faced the fact that his time at the top is over.