Nadal and Djokovic faced each other the semi-finals of the Madrid Open last week which the former won in straight sets on the way to the title.
Nadal improved his record on clay this year to 17-0 with a 6-3, 6-4 victory over American Jack Sock, the 13th seed.
Bautista Agut - on his favoured surface - made nothing easy for Djokovic but the Serbian No. 1 stood up to everything thrown at him to secure an important 6-4 6-4 win.
This is something unheard of, and hence Djokovic will be desperate to win the ongoing Rome Masters, where he is set to face Juan Martin Del Potro in the quarterfinals on Friday.
"I thought I played pretty well out there", said Isner, who is ranked 24th.
Fourth-seeded Nadal broke Sock's serve twice in the second set and served out the match to set up a last-eight meeting with Dominic Thiem, who was beaten by Nadal in the Madrid Open final last week.
"I feel like today's match was one of the better ones that I have played this clay-court season, but also in the past couple of months", Djokovic said.More news: Downpour halts Djokovic-Del Potro quarter-final
"I went out there with the belief that if I played well and executed my game plan, I could walk off that court with a win". "It came at the right time, of course".
Murray's best performance was winning the Dubai title in February, but he looks to be struggling to replicate the blistering displays that carried him to the number one spot at the end of previous year. I can play a bit more aggressive than the way I played tonight, but overall I'm happy.
The Austrian recovered from losing the first set to beat Querrey 3-6 6-3 7-6 (9-7), saving three match points before finally coming out on top in a thrilling tie-break.
Meanwhile, unseeded American John Isner battled into the Rome Masters semis with a 7-6 (7/3), 2-6, 7-6 (7/2) win over Croatian sixth seed Marin Cilic.
In the women's draw, Venus Williams defeated Johanna Konta 6-1, 3-6, 6-1.
Fifth seed Milos Raonic overcame Tomas Berdych 6-3 6-2 and will face Alexander Zverev, a 6-3 6-3 victor over Andy Murray's conqueror Fabio Fognini, in the last eight.
Australian Daria Gavrilova beat former finalist and 10th seed Madison Keys 2-6, 7-5, 7-5, while Dutch 15th seed Kiki Bertens put out Monica Niculescu of Romania 2-6, 6-2, 6-1.