Andy Murray completed a fairytale return from hip surgery by winning the Queen's Club doubles title with Feliciano Lopez, who ended Sunday with two titles after earlier winning the singles title as well.

The Spaniard is the first man to win both titles at the grass-court tournament in London since Mark Philippoussis in 1997.

Murray spent five months away from the sport until this week. He and Lopez defeated Rajeev Ram and Joe Salisbury 7-6 (6), 5-7, 10-5 in the doubles final — not long after Lopez outlasted Gilles Simon 6-2, 6-7 (4), 7-6 (2) in the singles.

Murray capped a remarkable week 146 days after undergoing what he hopes was career-saving hip surgery. In January he had said he was planning to retire after Wimbledon because of the severe pain he felt on a daily basis.

The three-time Grand Slam champion is approaching Wimbledon, which starts July 1, full of confidence after playing freely and without pain as he secured his first doubles title since winning with his brother Jamie Murray in Tokyo in 2011. Murray won't play singles at Wimbledon but has already confirmed that Frenchman Pierre-Hugues Herbert will partner him in the men's doubles.

Murray and Lopez hadn't played together in a tournament before beating top-seeded Juan Sebastian Cabal and Robert Farah on Thursday. They completed their darkness-delayed quarterfinal win over British duo Daniel Evans and Ken Skupski on Saturday, right before their semifinal win over Henri Kontinen and John Peers.

Lopez, who had been forced to play in three matches on Saturday including his singles semifinal, played almost 5 hours of tennis altogether on Sunday. He reaffirmed his status as the tournament's oldest winner at age 37 with the singles title.

The veteran Spaniard was already its oldest winner when he took the title in 2017.

Lopez was playing his first final since defeating Marin Cilic in the decider two years ago and was made to work hard by the 34-year-old Simon.

Lopez saved all but one of the break points he faced and converted three of his 13 opportunities to prevail in 2 hours, 49 minutes. Lopez had won five of their previous seven meetings and all four on grass.

Lopez is the first wild card to claim the title since Pete Sampras defeated Tim Henman to win in 1999. He would have been the oldest player to win a tour-level title since the 43-year-old Ken Rosewall won the Hong Kong Grand Prix final in 1977, but Roger Federer beat him to that accolade after winning his 10th Halle Open title earlier Sunday. Federer is a month older than Lopez.