Rublev won this tournament in 2020 and looked to be on his way to the final four after a strong opening set put him ahead.
But Lehecka battled back in the second to level the match and then found a crucial break in the second game of the deciding set to seize the advantage.
It was a lead he would not relinquish, holding his nerve despite watching a pair of match points come and go to clinch victory and knock out the world number five.
Lehecka will meet Murray in the semi-finals after the Brit came from a set down to see off Alexandre Muller 4-6 6-1 6-2 and keep his hopes of winning the Qatar Open for a third time alive after back-to-back titles in 2008 and 2009.
A tough opener had Murray facing a deficit against the world number 170, but a typically gutsy display saw him pull off the comeback and reach his first tour-level semi-final since June 2022, when he lost in the Stuttgart Open final to Matteo Berrettini.
Medvedev sealed his place in the final four with a hard-fought 6-2 4-6 7-5 win over Christopher O'Connell.
The world number eight triumphed for the seventh straight match, but did not have it all his own way against his Australian opponent, needing a crucial break with the final set tied at five games each to put himself back into the ascendancy.
Felix Auger-Aliassime awaits Medvedev in the next round after prevailing over Alejandro Davidovich Fokina in straight sets.
The world number nine out-aced his opponent eight to two to author a 6-4 7-6 (7-5) victory after one hour and 48 minutes, and he will look to improve on his dismal record against Medvedev on Friday, having lost all five of his meetings against the Russian.
At the Open 13 Provence, top seed Hubert Hurkacz reached the quarter-final after rallying from a set down to see off Leandro Riedi 4-6 6-3 6-2.
Second seed Jannik Sinner was forced to withdraw through illness, sending wildcard Frenchman Arthur Fils into the final eight, where he will meet Stan Wawrinka.
Alex De Minaur teed up a clash with Benjamin Bonzi by cruising past Alexander Ritschard 6-3 6-3, while world number 25 Grigor Dimitrov will play Alexander Bublik on Friday after beating Gijs Brouwer in straight sets.
Moutet, 20, beat Milos Raonic in the second round and on Friday overcame Fernando Verdasco and top seed Stan Wawrinka in three sets to reach his first final at this level.
However, getting the better of Rublev - the runner-up in 2018 - proved too much of a challenge, with the promising 22-year-old kicking off his season by claiming a third ATP Tour title of his career that will send him into the top 20 for the first time.
Rublev did not drop a single set throughout the tournament and after taking a 6-1 lead in the second-set tie-break against Moutet he did not look like missing out on the trophy.
"It's amazing. For the moment I have no words. I'm always really happy to play here and to win a title here is something special for me. It's an amazing start to the season and I can hope to continue the same level," Rublev said in his on-court interview.
"There's still much to work on, but I'm happy to become a top-20 player. I still have huge room to improve and I want to try to my maximum and see what happens."
Finn Ruusuvuori ousted the sixth seed with a 7-5 6-4 victory in Doha with a powerful display.
There were 26 winners from the racket of Ruusuvuori, who had only come out on top in one of his previous eight matches against top-30 opponents.
Ruusuvuori's next assignment will be a meeting with Jiri Lehecka, who saw off qualifier Damir Dzumhur 6-3 7-6 (7-3).
Roberto Bautista Agut, the fifth seed from Spain, saw the back of Marton Fucsovics 7-6 (9-7) 5-7 6-4.
Botic van de Zandschulp, Tallon Griekspoor and Soonwoo Kwon also made it through to round two.
Maxime Cressy had to dig deep to make it out of the first round of the Open 13, beating Geoffrey Blancaneaux 6-3 6-7 (5-7) 7-6 (7-4).
The fifth seed from the United States was joined in the last 16 by David Goffin, who defeated qualifier Lukas Klein 6-2 6-4.
Eighth seed Marc-Andrea Huesler made an early departure after going down in straight sets to Gregoire Barrere in Marseille.
The top-seeded Canadian lost in just an hour and 20 minutes as Rinderknech sealed a 6-4 6-4 victory to seal his place in the semi-finals in Doha.
Shapovalov struggled throughout, making nine double faults and having to face 10 break points, of which he managed to save eight.
Rinderknech will now face Nikoloz Basilashvili after the Georgian fought back to beat Marton Fucsovics 1-6 6-3 7-5.
The other semi-final will see Karen Khachanov take on Roberto Bautista Agut, with the Russian also coming from a set down in beating Marin Cilic 3-6 6-3 6-4.
Bautista Agut followed up Wednesday's 6-0 6-1 victory against Andy Murray by again winning comfortably against fellow Spaniard Alejandro Davidovich Fokina, scoring a 6-1 6-1 success.
The number two seed won 74 per cent of points when landing his first serve as he sealed victory in an hour and 17 minutes.
At the Open 13 in Marseille, Rotterdam champion Felix Auger-Aliassime increased his winning streak to six matches after beating French veteran Jo-Wilfried Tsonga 7-6 (7-3) 6-2 to head through to the quarter-finals.
"It was a special moment," Auger-Aliassime said after his win. "When the match was coming to the end, I knew it was going to be a special moment, a full-circle moment. He was my top idol growing up and I saw myself in him at times."
Auger-Aliassime will play world number 49 Ilya Ivashka next, while top seed Stefanos Tsitsipas also went through after a 6-3 7-6 (7-4) win against Hugo Gaston. The Greek star will play Russian Roman Safiullin in the last eight.
Ninth seed Benjamin Bonzi beat fellow Frenchman Pierre-Hugues Herbert 6-4 6-3 and will go up against Aslan Karatsev in the next round, while Lucas Pouille overcame Radu Albot 6-3 3-6 7-6 (7-2) and will tackle Andrey Rublev next.
Swiss legend Federer had been out of action for 14 months after undergoing knee surgery, but he was back in business with a 7-6 (10-8) 3-6 7-5 win over Briton Evans.
The 20-time grand slam champion had spent a lot of time practicing with Evans in recent weeks before making his comeback and they spent another two hours and 24 minutes on court in a tight tussle on Wednesday.
Federer was delighted to be back after such a lengthy absence and the 39-year-old's next test will come against Nikoloz Basilashvili in the quarter-finals in Doha.
He said: "I was tired, I was more focused on being tired than winning the points. If I was going to go out, I was going to go out swinging. Dan had more energy left at the end but I was serving well and I thought I played a really good match. I'm incredibly happy about my performance.
"It was a pleasure to share the court with Dan and always nice to finish off with a backhand down the line on match point. The important think is how I feel tomorrow and the next day and so forth for the next six months.
"It's been a long and tough road for me. I enjoyed it though, it's been a huge challenge in my tennis career."
Top seed Dominic Thiem earlier needed three sets to defeat wildcard Aslan Karatsev 6-7 (5-7) 6-3 6-2, while the in-form Andrey Rublev was given a walkover after Richard Gasquet withdrew due to a leg injury.
Denis Shapovalov beat Vasek Pospisil in an all-Canadian encounter, while Roberto Bautista Agut was among the other winners.
Karen Khachanov reached the quarter-finals of the Open 13 Provence with a 7-6 (7-4) 6-4 win over Mackenzie McDonald, while Jannik Sinner ousted Hugo Gaston in straight sets.
Cameron Norrie, Matthew Ebden and Egor Gerasimov were also victorious in Marseille.
The second seed was upset by French world number 93 Pierre-Hugues Herbert, as the doubles expert scored a 6-7 (6-8) 6-4 6-2 win.
Herbert had won only one singles match on tour in 2021 before this week, but Kei Nishikori and Cameron Norrie fell to the 29-year-old in the early rounds before he stunned world number five Tsitsipas.
It was a first career win in singles over a player ranked in the world's top five for Herbert, and he said: "It has been an incredible week for me so far, especially this match."
Quoted on the ATP website, Herbert added: "I knew I was going to have to play an amazing match to have a chance to win and I managed to do that. I am really happy about the way I played. I am so happy to be in the semi-finals here."
A French finalist is guaranteed as Herbert will face compatriot Ugo Humbert in the semi-finals on Saturday.
Humbert beat another Frenchman, world number 138 Arthur Rinderknech, in a tight contest, saving a match point and coming through 4-6 7-5 7-6 (7-4) in two hours and 36 minutes.
Russian top seed Daniil Medvedev chased off the threat of Jannik Sinner at this indoor event for the second year running, securing a 6-2 6-4 success against the Italian teenager.
Their only two career meetings have come in Marseille, and Medvedev bossed this encounter, taking three of his five break chances and holding serve throughout.
He will face Australian Matthew Ebden in the final four after the world number 287 earned an eye-catching 4-6 6-4 6-2 win over Russian third seed Karen Khachanov, who was champion in 2018 in Marseille.
At the Qatar Open, Nikoloz Basilashvili backed up his three-set win over Roger Federer by reaching the final of the tournament.
The Georgian scored a 7-6 (7-3) 6-1 semi-final victory over American Taylor Fritz in a clash of two unseeded players.
Basilashvili will tackle Spain's Roberto Bautista Agut for the title on Saturday after the fifth seed ousted Russian third seed Andrey Rublev.
A 6-3 6-3 win for Bautista Agut nudged the man from Castellon de la Plana into a 3-2 career head-to-head lead over his Muscovite opponent.
In his first match of 2020, top seed Wawrinka saved six of the seven break points he faced and came from 0-3 down in the second set to book a meeting with Aljaz Bedene, who overcame Alexander Bublik 6-3 7-5.
Laslo Djere defeated Lorenzo Sonego 6-1 3-6 6-2 and Mikhail Kukushkin downed Malek Jaziri 6-0 6-3, earning a clash with second seed Andrey Rublev in round two.
Wawrinka's doubles partner Frances Tiafoe – seeded eighth in the singles – lost 6-4 4-6 6-4 to Marton Fucsovics, while Pierre-Hugues Herbert and Cem Ilkel also progressed.