Andy Murray, of Great Britain, celebrates after defeating Richard Gasquet, of France, 6-7, 1-6, 6-2 during a semifinal match at the the Sony Open tennis tournament on Friday, March 29, 2013, in Key Biscayne, Fla. AP

KEY BISCAYNE, Florida — Andy Murray returned to the final of Sony Open with a 6-7 (3), 6-1, 6-2 win Friday over No. 8-seeded Richard Gasquet.

Murray lost a set for the first time in tournament when Gasquet played a brilliant tiebreaker. But Gasquet appeared to hurt his right foot and received treatment from a trainer after the second set, and he limped at times in the latter stages of the match.

Murray’s opponent Sunday will be No. 3-seeded David Ferrer, who beat No. 15 Tommy Haas, 4-6, 6-2, 6-3. Murray won the tournament in 2009 and was runner-up last year.

The Scotsman overtook Gasquet despite twice double-faulting on break point. He had a 38-19 edge in winners and converted seven of eight break-point chances.

He’s ranked No. 3 and would climb to No. 2 if he wins the title.

The No. 3-seeded Ferrer won the last five games of his semifinal and improved to 25-4 this year. He leads the tour in victories and is trying to become the first Spaniard to win the Key Biscayne men’s championship. Rafael Nadal is a three-time runner-up, and Spaniards are 0-5 in the final.

“I will try to do my best to win Sunday,” Ferrer said. “It’s going to be very difficult.”

The path to the title was made easier because Nadal and Roger Federer skipped the tournament, and Novak Djokovic was upset by Haas in the fourth round.

The 34-year-old Haas, the oldest man in the top 50, took a 3-1 lead in final set but appeared to tire and was undone by a flurry of errors down the stretch. The 5-foot-9 Ferrer doggedly chased down shots as usual, winning the majority of long rallies and taking advantage of a poor serving day by Haas.

“He started playing more solid,” Haas said. “He made life pretty tough on me. I started missing a little bit and came up a little too often. He didn’t miss at all anymore.”

The No. 18-ranked Haas put only 43 percent of his first serves in play and was broken six times. Ferrer’s serve was better, and he held the last game at love.

“I tried to fight every point,” Ferrer said. “I know Tommy, in the third set, was a little bit more tired than me.”

Ferrer had lost in his two previous appearances in the semifinals in 2005 and ’06.

Haas, who is projected to crack the top 15 next week for the first time in five years, raced to a 5-2 lead in the opening set but after that looked nothing like the player who upset Djokovic on Tuesday. He shanked half a dozen backhands and blew several easy volleys, which left him cursing and waving his arms in frustration.

“I’m going to have to let this sink in a little bit,” Haas said. “Anytime you lose, it’s tough. But it has been an unbelievable tournament, something that I will definitely cherish for the rest of my life.”

Ferrer showed little emotion until the last game. When Haas’ final shot fell out of play, Ferrer collapsed on his knees at the net, raised his fists in triumph and fought back tears.

He hopes to do it all over again Sunday. Ferrer seeks his second Masters 1000 title after winning his first at Paris in November. He has been a top-10 player since 2010 but rarely receives the attention of other top players.

“I’m very happy with me, with my career of tennis,” he said this week. “I don’t mind a lot whether I am an important player or not. I enjoy a lot my job.”

Complete stories on our Digital Edition newsstand for tablets, netbooks and mobile phones; 14-issue free trial. About to step out? Get breaking alerts on your mobile.phone. Text ON INQ BREAKING to 4467, for Globe, Smart and Sun subscribers in the Philippines.

Disclaimer: The comments uploaded on this site do not necessarily represent or reflect the views of management and owner of INQUIRER.net. We reserve the right to exclude comments that we deem to be inconsistent with our editorial standards.