Three-time grand slam winner Wawrinka, who is the oldest player in the main draw, hit back in the Spanish capital to progress 6-7 (7-3) 6-3 7-6 (7-4).
The 38-year-old won 46 of 54 first-serve points and now has a couple of days to recover before facing fifth seed Rublev, who was handed a bye to the last 32.
Roberto Carballes Baena is also through after defeating David Goffin 6-4 6-4, with Alexander Zverev up next, while Alex Molcan saw off Wu Yibing 6-2 6-4.
There was a shock elsewhere on Wednesday as Diego Schwartzman was downed in straight sets by Hugo Grenier.
The former world number three made his comeback after more than a year out with a left foot injury that required two surgeries but fell to a 3-6 7-5 6-2 defeat to Alexander Bublik in the first round.
Wawrinka, who entered the tournament as a wildcard having slipped to 236 in the world rankings, came from a break down to take the opening set but fatigue eventually set in and he was eliminated after two hours and seven minutes.
"I think the body's getting much better," said Wawrinka, who lost in straight sets to Elias Ymer at a Challenger tournament in Marbella two weeks ago.
"I'm still far away from where I want to be, but I think I'm [going in] the right direction. I think today was a positive match. It was a tough loss, of course, but I'm happy with the way I was playing today.
"I was playing better, feeling better on the court physically. I spent a lot of mental energy to focus, to stay there as it was tough at the end. But I'm happy with what I have done."
Ninth seed Sinner was taken the distance by Coric before completing a 6-3 2-6 6-3 victory to advance to the second round.
Sinner took a medical timeout in the second set while he dealt with some apparent abdominal pain, but he was able to battle back and take the win.
Diego Schwartzman needed over three hours to come from behind and defeat Karen Khachanov 6-7 (5-7) 6-3 6-3, while his fellow Argentine Federico Delbonis set up a clash with second seed Alexander Zverev by besting Jaume Munar 6-4 3-6 6-4.
Reigning champion Stefanos Tsitsipas faces a meeting with Fabio Fognini in the second round after the Italian overcame Arthur Rinderknech 7-5 4-6 6-3.
There were also wins for Hubert Hurkacz, Pablo Carreno Busta, Marin Cilic, Alex de Minaur, Albert Ramos-Vinolas and Sebastian Korda.
Teams and players in North America boycotted several games across different sports on Wednesday over the police shooting of Jacob Blake, a black man, in Wisconsin.
Blake was repeatedly shot in the back by police, prompting nationwide protests within professional sports.
After two-time grand slam champion Naomi Osaka announced she would not play her Western & Southern Open semi-final against Elise Mertens scheduled for Thursday, the tournament was paused.
"As a sport, tennis is collectively taking a stance against racial inequality and social injustice that once again has been thrust to the forefront in the United States," a statement read.
"The USTA, ATP Tour, and WTA have decided to recognise this moment in time by pausing tournament play at the Western & Southern Open on Thursday, August 27.
"Play will resume on Friday, August 28."
It remains unclear if that means Osaka will take her place in the draw. The other women's semi-final is between Victoria Azarenka and Johanna Konta.
Novak Djokovic is due to face Roberto Bautista Agut in a men's semi, while Stefanos Tsitsipas is scheduled to take on Milos Raonic.
The 21-time grand slam winner is set to sit out the Indian Wells Open and Miami Open after the US extended the requirement for all non-American nationals to be vaccinated.
Djokovic's participation at August's US Open may also be in doubt should those requirements, which are currently in place until April 10, continue to be extended.
But having also been forced to miss events in the likes of the US, Canada and Australia last year, Djokovic accepts he may have to do the same in 2023.
"I don't think there's anything official yet, so when it is we can speak about it," Djokovic told reporters on Thursday when asked about the US restrictions.
When told the rules have been certified by the US Transportation Security Administration, Djokovic replied: "I mean, if it is official then it is – what can I do? Nothing.
"You know my position, so it is what it is. I'm hoping [to play], but if I can't go, I can't go."
Djokovic, cleared to compete in Australia this year, was speaking after defeating Quentin Halys 7-6 (7-3) 7-6 (7-5) in the last 16 of the Adelaide International.
The 35-year-old, who beat Constant Lestienne in straight sets in his opening singles match of 2023, trailed 5-2 in the first set but recovered well and then edged the second set.
"It was a great performance from my opponent today and I want to congratulate him for a great fight," Djokovic said in his on-court interview. "He played like a top-10 opponent.
"He was serving big, hitting his spots and on a fast court like this it's tough to break, so two tie-breaks is a realistic score in today's match. I'm glad to overcome the challenge."
Djokovic will now face Denis Shapovalov, who saw off Roman Safiullin 6-4 6-3, for a place in the semi-finals.
"Denis is one of the most complete players out there," Djokovic said of his next opponent. "He has a very dynamic style of tennis.
"I haven't played him for a while so I'm looking forward to it. Every match from here gets tougher."
Sebastian Korda also advanced on Thursday with a 6-4 6-4 victory against Roberto Bautista-Agut, while Jannik Sinner beat Thanasi Kokkinakis 7-6 (7-2) 6-4.
At the Maharashtra Open in Pune, top seed Marin Cilic withdrew from his quarter-final with Tallon Griekspoor due to a knee injury.
World number 95 Griekspoor will now face Aslan Karatsev for a place in the final.
Nadal landed the landmark singles win of his career as he came from a set down to defeat Feliciano Lopez 4-6 7-6 (7-5) 6-4 at the Paris Masters.
Wednesday's clash was the first time Nadal has played since he claimed his 13th French Open title last month.
The 34-year-old now sits fourth on the list of players with the most wins in the Open Era, behind Jimmy Connors, Roger Federer and Ivan Lendl.
Though proud of his long career, Nadal did point out one negative to reaching the milestone.
"Of course [I am proud] but there is one negative thing and that is that you are very old to get to 1000, you are very old," Nadal told reporters.
"Because to win 1000 matches you have to have a long career, but I am super happy. To arrive at that number means I did a lot of things well over a long time.
"Thanks to everybody – the ATP, to the French Federation, to everybody, my uncle, it's not the same without the crowd.
"I am proud of a lot of things honestly, but I faced some challenges in my career, ball injuries and I always have the passion to keep going and the dedication and humility to accept the challenges when things don't go the way you expect.
"Of course it's a big achievement to be playing at the age of 34 and at the same time still being competitive is still something very important for me and makes me feel proud and happy and proud about all the things that, not just me, the whole team have achieved."
Nadal, who has never won the Paris Masters, was imperious at Roland Garros, but looked far less assured at the Bercy Arena.
Lopez made a strong start, with a break of serve in the opening game resulting in him taking the first set, but Nadal hit back by edging a tie-break and then breaking his compatriot – who he has a 14-10 winning record against – at the start of the decider.
"It was very tough match, I started in the worst way possible with the break against him," Nadal added.
"It's difficult as you are under pressure the whole match. I am very happy to finally find a way to win because you don't want to be in a tie-break for the whole match against a big server like Feliciano and a very good player from the baseline, especially on this surface."
Last year's runner-up Andrey Rublev, however, missed out on a last-eight spot after falling to a three-set defeat against Jannik Sinner.
World number three Zverev overcame Spain's Pablo Carreno Busta 6-2 7-5 to progress in Monaco, where he is seeking to win the sixth ATP 1000 title of his career.
"For the second clay-court match of the season, I can't complain too much," the 24-year-old second seed said on court after sealing the victory.
"Yes, I lost focus a little bit in the second set, but at the end of the day, he's somebody that can really play. I'm happy with a two-set win."
Tsitsipas (3) remains in contention for a second consecutive title in the principality after defeating Laslo Dere 7-5 7-6 (7-1) and will face off against 12th seed Diego Schwartzman for a semi-final spot after the Argentine defeated Lorenzo Musetti in a hard-fought three-set encounter.
There will be no repeat of 2021's final between Tsitsipas and Rublev, however, after the Russian fell to a thrilling 5-7 6-1 6-3 loss to ninth seed Sinner in the day's final contest.
The other seed to fall victim to a shock in the last 16 was world number seven Casper Ruud, losing 6-3 7-5 to Grigor Dimitrov, who will face Poland's Hubert Hurkacz in the last eight.
Finally, Novak Djokovic's conqueror Alejandro Davidovich Fokina cruised past David Goffin 6-4 6-1 to set up a quarter-final tie with the United States' Taylor Fritz, who bested compatriot Sebastian Korda – with whom he played doubles with in Monte Carlo – in straight sets.
Zverev, who is ranked third in the world - two places higher than Tsitsipas - fought back to defeat Jannik Sinner 5-7 6-3 7-6 (7-5) in his quarter-final match, denying his opponent another top-five seed scalp following his prior win over Andrey Rublev.
"It means a lot, definitely, especially [with] how this year has been going so far for me," said Zverev after a gruelling three hours on court.
"I've lost long matches like that, so I’m happy I won this one."
Tsitsipas also orchestrated a superb turnaround against Diego Schwartzman, prevailing 6-2 6-7 (3-7) 6-4.
The Greek had looked set for a last-eight exit at four games down in the final set, only to stage a dramatic comeback to keep his hopes of a first title since last May's Lyon Open alive.
"There was a moment in the match where I felt what I was doing wasn't working," Tsitsipas said.
"He had a massive lead and momentum in what he was trying to do. I just tried to stay in the match as much as I could and that worked out very well.
"I wasn't expecting much at that point being a double break down, so I relaxed at that point."
Schwartzman meanwhile will rue his inability to put the tie to bed, having already reached two ATP finals this year.
Grigor Dimitrov and Alejandro Davidovich Fokina will face off in the other semi-final.
Bulgarian Dimitrov beat off Hubert Hurkacz in another final-set tie-break, winning 6-4 3-6 7-6 (7-2).
Fokina, who eliminated Novak Djokovic in the second round, turned over Indian Wells champion Taylor Fritz in another comeback result, triumphing 2-6 6-4 6-3.
The Olympic champion had not won a match in Cincinnati prior to this year's tournament, but Sunday's one-sided final capped a remarkable turnaround for the world number five.
Zverev raced into a 4-0 lead before securing the opening set 6-2 as he produced no errors across the first seven games.
The third seed carried on his domination, breaking Rublev in his opening service game of the second set to pave the way for the 17th ATP title of his career within an hour in the showpiece.
After paying tribute to "his best friend on Tour" Rublev, Zverev added in his on-court interview: "It is incredible that tennis can be back, sport can be back, and we can watch and play this beautiful sport again.
"I normally do not look forward to this week - not winning a single match in seven years - but this has now become one of my favourite times of the year for me, hopefully it can be for the next 10 to 15 years."
The 24-year-old reached the final of the US Open last year, though he will now eye going one step further as the tournament commences at the end of August.
Zverev was dominant on serve, giving up only two break points for the match with a 73 per cent first-serve rate, while winning 40 of a total 48 points on his first serve.
The German will now aim to defend his title in Sunday's final when he faces Carlos Alcaraz, who defeated world number one Novak Djokovic earlier on Saturday.
The second seed will be seeking his sixth ATP 1000 title, with Sunday's final against the home favourite to be his 10th at that level.
"I'm just extremely happy to be in the final here," Zverev said post-match. "I know it's going to be an extremely tough match tomorrow but I hope I can manage to play my best and give myself a chance.
"It's going to be his [Alcaraz] court for the next 15 years probably. It has been Rafa's [Nadal] court for the past 15 years and it's going to be his court for the next 15 years.
"I just hope I can give him some trouble and I hope I can manage to win tomorrow."
Tsitsipas was similarly strong on his first serve but had a much lower rate at only 56 per cent for the match. Zverev simply had more looks at his opponent's second serve, winning 15 points compared to Tsitsipas' eight, but with each holding a 44 per cent success rate.
The defending champion at Caja Magica capitalised when it mattered, though, claiming the opening three games in the deciding set to set up the eventual win.
Zverev was punished for a slow start as Tabilo took the opener within 32 minutes, but the German fought back in a one-hour, 15-minute slog of a second set.
The 2017 Italian Open champion put his foot down from 3-3 in the second-set tie-break, with Tabilo potentially feeling the effects of a fine run that included a last-32 upset of Novak Djokovic.
Zverev upped the intensity in the final set and won a huge 94 per cent of points behind his first serve as his opponent wilted, the third seed reaching the Rome final for a third time.
Data Debrief: Zverev draws level with Becker
Zverev will now face either Nicolas Jarry or Tommy Paul in Sunday's final, which will be his 11th at ATP 1000 Masters level.
That tally pulls him level with Boris Becker for most such finals by a German player since the format's 1990 introduction.
Zverev – who triumphed on the clay in Rome back in 2017 – produced a dominant serving performance against another heavy hitter in Fritz, but only after an awkward fall early on.
The German sought medical attention after falling on his stomach in the third service game of the match, the slip leaving him bleeding from both hands.
However, he soon shook off that knock and did not allow Fritz a single break point in a deeply impressive display, setting up a semi-final meeting with Chile's Alejandro Tabilo – the conqueror of Novak Djokovic – for Friday.
Data Debrief: Zverev gathering momentum
Zverev, the lone former champion remaining in the men's draw, is surely the favourite to win a tournament characterised by unfortunate withdrawals and shock defeats for the biggest names.
Seven of Zverev's 21 tour-level titles have come on clay, and he is yet to drop a single set in Rome this year. His three-year wait for an ATP 1000 title could soon be over.
American Fritz saved two match points to pull off an upset 4-6 6-4 7-6 (7-3) win over Olympic gold medallist Zverev.
Third seed Zverev was aware he had become hot favourite to triumph in California after Stefanos Tsitsipas crashed out to Nikoloz Basilashvili earlier on Friday, with US Open champion Daniil Medvedev already eliminated.
And the German was frustrated with his performance against Fritz, which left him unable to add to the Masters 1000 titles he has already won in Madrid and Cincinnati this year.
"It was just not really my day, to be honest," said Zverev, who had beaten Jenson Brooksby, Andy Murray and Gael Monfils to reach the last eight.
"I was close to winning, but the level of tennis was just not there for me.
"Mentally this is not easy for me. My next tournament is Vienna, so hoping I can deal with it well there, but right now I just want to go home.
"It was a very long season and I have played well but this one hurts because I knew that, after Stefanos lost this morning, I was kind of the favourite to win this tournament, but my tennis wasn't there yet."
Zverev had won 20 of his previous 21 matches on hard courts and led 5-2 in the deciding set.
But Fritz was not to be denied, firing 36 winners to secure the second top-five win of his career, with this triumph adding to impressive victories over Italian duo Matteo Berrettini and Jannik Sinner this week.
Fritz said: "This is the farthest I've ever been in a big tournament.
"It is easily the best win of my life, against a really tough opponent on arguably the biggest match I could possibly play, so it's great.
"The biggest thing was match point down, I wanted to make him serve it out, so I just fought as hard as I could to hold that game.
"Then I got fortunate in his service game and from there I felt in control and felt really good under the pressure. I kept fighting. The crowd pushing me on meant so much.
"It is amazing. Especially the way that match ended with such high emotions with the crowd. The crowd was amazing and it is a dream come true."
The German followed up his famous win over home favourite Rafael Nadal by defeating Austria's Thiem 6-3 6-4 in the semi-final on Saturday.
Zverev, who won this event in 2018, will meet either Casper Ruud or Matteo Berrettini in the final.
Thiem had won the last four meetings between the two, including in last year's Australian Open semi-final and the US Open final, where he came from two sets down to win in an incredible fifth-set tie-break.
Zverev said after his victory over Nadal that he would be thinking about that crushing loss in New York prior to his meeting with Thiem.
And he was able to gain a small measure of revenge for those recent grand slam defeats in the Spanish capital.
"We have had some fantastic matches," said Zverev. "We have played the biggest matches in the world. We have played Masters 1000 finals, we have played grand slam finals and [the rivalry] is still developing.
"It is still going to go on for a few more years. Hopefully we will play a few more amazing matches. It feels very [sweet to win], it is a rivalry where he kicks my a** most of the time!
"It is going to mean a lot to me [if I can win the final].
"I am definitely looking forward to playing another big final and I hope I can turn it my way this time."
A solitary break of serve was enough for Zverev to claim the opening set.
He recorded two breaks in the second to go 4-1 up and although Thiem got one strike back, two more holds gave Zverev - who forced 11 break points to his opponent's two - a big victory.
The world number six is yet to drop a set this week but has lost his last three Masters 1000 finals going into his latest attempt on Sunday.
Thiem, meanwhile, has reached the Madrid Open semi-finals in four straight years but it still waiting for his first triumph at the tournament.
The German had to do it the hard way at La Caja Magica over the past week, having previously seen off five-time winner Rafael Nadal and Dominic Thiem en route to the showpiece.
He was in a spot of bother against his Italian opponent at the end of a gripping first set that Berrettini took in a tie-break, Zverev's efforts in coming back from 5-0 down and earning a set point ultimately for nothing.
Berrettini eventually sealed the lead with his fourth set point but Zverev played with renewed focus at the start of the second, taking full advantage of a succession of mistakes with the score at 4-4 to force a decider.
Zverev's greater endurance in rallies then paid dividends early in the third as he broke to go 3-2 up, and Berrettini only won one more game as the German triumphed 6-7 (10-8) 6-4 6-3 to win the tournament for a second time.
Speaking afterwards, he said: "It is great [to win this title], especially after losing my last three finals I played at Masters 1000 events. This is definitely special and I just want to enjoy this one.
"[Berrettini's] game style showed it all. I didn't play anybody this week that can serve 235[km/h] on clay and serve 230km/h kick serves.
"It definitely was a different match and I am extremely happy right now."
On competing at the Internazionali d'Italia next, he added: "Rome is also an event I like and enjoy, so I hope I can perform [in] the same way as I did here and we will see how it goes there. I feel awesome."
This was the first time Zverev has beaten three or more top-10 players in a single competition since his ATP Finals victory in 2018.
The German, who also triumphed in Rome seven years ago, captured his first silverware of the season - and sixth of his career in an ATP Masters event.
Having dropped just a single set on the way to his 11th Masters final, Zverev continued his impressive form by winning 95 per cent of his first-serve points (37 out of 39) and committing just eight unforced errors.
Jarry had enjoyed an impressive fortnight in Rome, defeating Stefanos Tsitsipas and Tommy Paul on the way to becoming the first Masters finalist from Chile since Fernando Gonzalez (also at the Italian Open) in 2007.
However, just two break points were enough to deny the 21st seed a fourth career ATP title, with Zverev eventually converting his fourth championship point to ensure a return to the winner's circle.
Data debrief
Zverev joins Rafael Nadal (10) and Novak Djokovic (six) as one of only three players since 2000 to win the Italian Open on multiple occasions.
Landing his second crown in Rome seven years after his first, it marks the longest gap in seasons between two men's singles titles at the event in the Open Era.
Meanwhile, Zverev became the most successful German male in ATP Masters events since the format's introduction in 1990, with his sixth such success seeing him eclipse Boris Becker's total of five.
Zverev, who last in last year's final, saw match points slip from his grasp in the second set as Dimitrov levelled the match, however, he eventually prevailed on Thursday.
World number one Novak Djokovic benefited from a walkover, while Daniil Medvedev also moved through to the quarter-finals of the ATP Masters 1000 event.
Zverev outlasts Dimitrov
Olympic Games gold medallist Zverev had to dig deep for his 7-6 (7-4) 6-7 (3-7) 6-3 win over former world number three Dimitrov.
It was Zverev's seventh win on the bounce, but he was well aware of just how deep he had to dig to see off a resilient Dimitrov.
"Incredible match," Zverev, who won a fifth tour title of the year last week at the Vienna Open, said afterwards. "Grigor is playing very high-level tennis and I had to leave everything out there.
"I think it was a very high-level match and it could have gone both ways, especially the third set. I am happy with how things went in the end."
Djokovic moves through without playing
There was no such ordeal for top seed Djokovic, however.
Djokovic – a 20-time grand slam champion – received a walkover after Gael Monfils was advised not to continue with the tournament due to an adductor issue sustained in his previous win over Adrian Mannarino.
Taylor Fritz awaits five-time Paris champion Djokovic after the American saw off 10th seed Norrie 6-3 7-6 (7-3), while Casper Ruud will tussle with Zverev.
Ruud's emphatic 6-2 6-1 demolition of Marcos Giron clinched a historic achievement for the 22-year-old – who became the first Norwegian to qualify for the ATP Finals at the end of a breakthrough year in which no player can better his five tour-level titles.
Hubert Hurkacz did his chances of joining Ruud in Turin no harm as the Polish seventh seed – who holds the last automatic qualifying berth – fought back to defeat Dominik Koepfer 4-6 7-5 6-2 and set up a meeting with James Duckworth, who beat Alexei Popyrin 7-6 (8-6) 6-4.
Second seed and US Open champion Medvedev was another who had to come from behind before ultimately seeing off Sebastian Korda 4-6 6-1 6-3.
He will go up against Hugo Gaston, who became the first French qualifier to reach the Paris Masters quarter-finals since 1990 with his win over Carlos Alcaraz.
Olympic Gamed gold medallist and third seed Zverev fell behind a break in both sets but battled past Murray in straight sets at the ATP Masters 1000 tournament on Tuesday.
Tsitsipas – the second seed – rallied from a set down to vanquish Fabio Fognini in the desert, while fifth seed Berrettini was a third-round casualty.
ZVEREV CLAIMS COVETED SCALP OF MURRAY
Having already defeated Novak Djokovic, Rafael Nadal and Roger Federer in his career, all that was missing for Zverev was a win over Murray to complete the 'Big Four' sweep.
Zverev added Murray to his list of scalps with a 6-4 7-6 (7-4) victory to reach the Indian Wells fourth round for the first time since 2016.
The German star has now won 19 of his last 20 matches since Wimbledon.
"He's the only one of the Big Four that I hadn't beaten yet, so I'm happy that I've done it today," said Zverev, who will clash with 14th seed Gael Monfils in the next round. "Obviously it was a fantastic match.
"I thought Andy played extremely well, maybe as well as he's played since the surgery. I hope he continues playing the same way, because tennis did miss him for a long time and I think it's good to have him back."
TSITSIPAS FIGHTS BACK
It was far from easy for Greek star Tsitsipas, who prevailed 2-6 6-3 6-4 against 25th seed Fabio Fognini.
Tsitsipas added to his ATP Tour-leading haul of match wins this season, which now stands at 53 after Fognini had been looking to score his first victory over the French Open runner-up.
Alex de Minaur – the 22nd seed – awaits after he took down 13th seed Cristian Garin 6-4 6-2 for his first trip to the Indian Wells last 16.
BERRETTINI BUNDLED OUT
Wimbledon finalist Berrettini was no match for Taylor Fritz, who surprisingly topped the Italian 6-4 6-3.
Berrettini entered the contest as the only player on the ATP Tour this season to register double-digit wins on three surfaces – 15-4 (hard), 13-4 (clay) and 11-1 (grass).
"We're coming to the end of the year, I could really use a big result," said Fritz after claiming his first top-10 win of the year. "This is just what I needed, playing one of my favourite tournaments close to home."