How did Andy Murray get to No. 1? His 5-7, 7-6 (5), 7-6 (9) win over Milos Raonic at the World Tour Finals in London tells the story in all of its dramatic—and sometimes painful—detail. At three hours and 38 minutes, this semifinal was the longest two-out-of-three-set match in the history of the ATP’s season-ending championships. It was, to put it simply, a dogfight from start to finish.

Raonic held a match point in the third-set tiebreaker, and was two points from victory in the second-set tiebreaker. Murray served for the win twice, and was broken both times. In the end, both men rose to the occasion; in the final-set tiebreaker, with defeat staring them in the face every other point, they came up with their biggest shots and most electrifying gets of the afternoon. This wasn’t a case of two men playing their best at the same time, but it was a case of two men fighting their best at the same time.

Here’s a look at the highlight reel above; not surprisingly, it’s a long one. I’d suggest starting at the 13- or 14-minute mark, late in the second set. That’s where things start to become urgent for Murray, and where he does what he had been doing throughout the second half of 2016: finding a way, any way, to win.

*****

—Murray came into this semifinal having won 21 straight matches and four straight tournaments, including Masters events in Shanghai and Paris. Over the summer, he had won his second Wimbledon title and second Olympic singles gold. That week at the WTF in London, he had beaten the No. 3 (Stan Wawrinka), No. 5 (Kei Nishikori) and No. 7 (Marin Cilic) seeds in round-robin play. Yet if Murray wanted to hold off Novak Djokovic and finish the season No. 1 for the first time, he still needed a win over Raonic.

That was never going to be a straightforward task. Twice in 2016, in the semis at the Australian Open and the final at Queen’s Club, Murray was forced to come from a set down to beat Raonic. The Canadian, who had reached his first Grand Slam final at Wimbledon, was finishing up his own breakthrough season. This was the first time he had advanced to the semis at the WTF, and earlier in the week he had narrowly lost to Djokovic in two tiebreakers.

—In this match, Raonic showed off a lot of what made him a better player in 2016. He came to the net 61 times and won 41 of those points. This year he improved his volley and even added a little touch around the net—not an easy thing to do in your mid-20s. Against one of the game’s best baseliners, Raonic controlled points with his forehand and belted a few outright backhand return winners. All of those strokes are better than they were 12 months ago.

Raonic also proved that he can win without leaning entirely on his serve. Over the course of 18 service games and two long tiebreakers, he managed just 10 aces. And while Raonic has struggled mightily with his return in the past, he managed to break Murray twice when he was serving for the match.

Watching Raonic save a match point in the final-set breaker with a huge running forehand, I wondered whether this loss could end up being something like the 12-10-in-the-fifth loss that Wawrinka took to Djokovic at the 2013 Australian Open. That epic “fail” let Stan know that ultimately he could succeed against the Big Four, and the next year he won his first major in Melbourne. Could we see something similar from Raonic at a Slam in 2017?

—We might have seen it in this match, if Murray hadn’t been so driven to complete his late-season sweep and end the year No. 1. From the start, you could see this wasn’t going to be his best day. He hit just 27 winners against 36 errors. He struggled to get much pace on his forehand; at the start of the third set, we see him hit one winning forehand, only to shank the next one into the ceiling. And if we thought Murray was going to be calmer or better behaved with Ivan Lendl back in his corner, this match let us know we should think again. Murray was in full rant mode all the way through. He reached his peak of rage when he yelled at a ball that flew past him for a winner.

“Damn yoooouuuu!” he hollered.

In other words, if you’re looking to show someone the benefits of positive language, this match would not be at the top of your list of examples. From what I can remember, Murray’s lone upbeat moment came three hours and 20 minutes in, when he fist-pumped after hitting a forehand winner to go up 5-3 in the third-set breaker. Then he promptly lost the next two points. That’s what you get for being happy, Andy.

—You don’t end up with 23 straight victories without pulling out a few matches that you probably should have lost. Two weeks earlier in Paris, Murray had survived Fernando Verdasco 7-5 in the third set, come back from 1-6 down in a tiebreaker to beat Tomas Berdych and snuck past John Isner 6-4 in the third. Earlier in the week in London, Murray had lost the first set to Kei Nishikori before fighting back to win 6-4 in the third.

The Raonic match was the logical conclusion to all of those close calls. This time Murray found a way by finding his way to the net. At 5-5 in the second-set tiebreaker, two points from defeat, he came up with his slickest volley of the day, a sharp-angle forehand winner. Down match point in the third set, Murray took the initiative again and did just enough with a backhand volley to win the point and save his No. 1 ranking.

“I really tried, in the best way possible, [to] leave it all out there,” a thoughtful and undepressed Raonic said afterward. “I turned it around for myself there at the end of the third ... I just did everything I could— everything that was within me, at least—to really try to win.”

“I fought hard,” Murray said. “I fought very hard this week. I have also the last few months, too. It would have been easy today when I was behind to have gone away a little bit, but I didn’t.”

Someday, we may look back and think that it only made sense that Murray, the fourth of the Big Four, would finish at least one season at No. 1. But those of us who watched his sprint to the finish, and saw all of the places where he could easily have been tripped up, will know that Murray’s achievement was about determination, not destiny.