In a battle of two former junior world number ones, the Russian broke when Rune was serving for the match, then saved match points before winning 6-3, 3-6, 6-3, 4-6, 7-6 (11/9) in sapping heat at Rod Laver Arena.
He will face nine-time champion Novak Djokovic for a place in the semi-finals after the Serbian fourth seed crushed Australia’s Alex de Minaur in straight sets.
“Today mentally was out of control, I was struggling a lot,” said Rublev.
“Yeah, was lucky. I don’t know if it was a present. Especially from 5-2 (down in the fifth), somehow I was able to win. I started to think it was over.
“Now I can go to the casino, for sure I’m going to win,” he added, laughing.
Victory put the 25-year-old into the Melbourne quarter-finals for a second time and the last eight for a seventh occasion at Grand Slams.
Despite being world number six Rublev, who has won 13 ATP titles, has never been able to go further.
He described beating Rune as “not like a rollercoaster, it’s like they put a gun to your head. A rollercoaster is easier.”
“I think I was never able to win matches like this,” he said.
With both players less than clinical on serve, Rublev broke the Dane with a forehand winner to take a 4-2 grip in the first set.
But Rune’s returns helped create chances and he broke straight back when Rublev played into the net from the baseline.
A Rune double fault immediately handed the advantage back to his opponent, and this time Rublev made no mistake in serving out the set in 37 minutes.
Undaunted, Rune clung on in a see-sawing 12-minute opening game in set two and turned the tables to break Rublev for a 3-1 lead, which he never relinquished.
With the sun blazing down, Rublev pounced in the sixth game of the next set, opening up three break point opportunities and making the most of them.
Down two sets to one, Rune called a trainer for what appeared to be a blood pressure test. Unperturbed, he got back to work and broke for 4-2 and took it to a fifth.
In a battle of attrition, Rune ground down Rublev to move to 5-2 in the decider, but he failed to serve out for the match.
Rublev then saved two match points to take it to the 10-point tiebreaker, where he bounced back from 7-3 down for a gutsy win.
“This one hurts a lot,” said a disappointed Rune. “It was super close. I had my chances. He played well.