The Australian, who has had a see-sawing second half of the year, lost the first set in Beijing on Saturday, before grinding his way back into the match.
After winning the first set 6-3, Halys opened up a 5-3 lead in the second and was serving for the match, before de Minaur rallied to break back, then clinch a neck-and-neck tiebreak 7-5 to set up a decider.
The third set was another close affair, before the 'Demon' was able to break at 5-5 and secure a hard-fought 3-6 7-6 (7-5) 7-5 win in two hours 47 minutes.
Victory evened up their head-to-head record at 2-2 and put de Minaur into the quarters, where the world No.10 will play Andrey Rublev, currently ranked No.20 in the world, but a former top-10 player himself.
Rublev was also pushed to the limit before beating fellow Russian Roman Safiullin 6-2 3-6 6-4.
De Minaur will be looking to repeat or better last year's performance at the ATP 500 event, when he made the semi-finals before losing to then world No.1 Jannik Sinner.
It has been an up-and-down year for de Minaur, who started 2026 off well by reaching the last eight at the Australian Open.
He continued that momentum into February, when he won the ATP 500 event in Rotterdam.
De Minaur followed that by reaching the French Open third round and fourth round at Wimbledon, before disappointingly bowing out in the second round of the US Open in September.
However, he bounced back impressively by steering Australia to victory over Poland in their Davis Cup clash in Brisbane, before beating German double grand slam champion Alexander Zverev at the Laver Cup in London.
Top seed Zverev cruised past home hope Shang Juncheng 6-0 6-3 in Beijing to set up a mouth-watering quarter-final clash against Novak Djokovic, whose perfect 31-0 record at the event will now really be put to the test.
"I've got a very difficult opponent tomorrow, but I'm looking forward to those challenges as well," Zverev said.
"I'm excited about it. This is one of his favourite courts, he's never lost here. Of course, I am going to do everything I can to make it a challenge, compete, and hopefully be successful."
Their most recent encounter came at the French Open last year, when Djokovic prevailed in four sets.
Meanwhile, Jannik Sinner has withdrawn from the upcoming Shanghai Masters as he continues to recover from the knee injury that's kept him out of action since he beat Zverev in the Wimbledon final in July.