The four-time winner in Rome saved all five break points late in the match, including one when he was serving for the match.
He set up match point with a long rally that included a rush to the net and back to the baseline to chase down a lob with an over-the-shoulder shot, finally setting up a volley winner into the open court.
Nadal closed it with an overhead smash on his first match point.
"I played with less intensity after 4-1 and it's impossible to play with less intensity at this level," Nadal said. "I had some problems the last two games with myself, but I saved it."
Second-ranked Novak Djokovic defeated Thomaz Bellucci 6-4, 6-4 and will meet Fernando Verdasco in the quarterfinals. Verdasco edged Guillermo Garcia-Lopez 6-4, 7-6 (2) to improve his record to 13-2 on clay this year.
"I didn't make enough returns and his serve had a very high percentage," said Murray, who failed to convert all three of his break points. "That was a big disappointment that I wasn't able to convert more break-point opportunities -- that's usually the best part of my game."
Murray has never won more than two matches at this warmup for the French Open, which begins May 23.
Djokovic will look to avenge his defeat to Verdasco in the semifinals of the Monte Carlo Masters two weeks ago.
"I've played a lot of matches against him on different surfaces and I've won most of them," Djokovic said of his 5-3 record against Verdasco.
Djokovic said the Monte Carlo match "wasn't a real picture of my game. I didn't feel good on the court and made a lot of unforced errors."
Jo-Wilfried Tsonga also advanced by beating Colombian qualifier Santiago Giraldo 6-3, 6-4, while Ernests Gulbis followed up his upset win over Roger Federer with a 6-2, 3-6, 7-6 (4) victory over Italian wild card Filippo Volandri and a partisan crowd.
Djokovic got in just 57 percent of his first-serve attempts but committed half as many unforced errors against the 28th-ranked Bellucci.
"I was down a break every set and it wasn't easy to get back on serve," Djokovic said. "He served well -- very accurately -- and got a lot of free points."
Djokovic is aiming to reach his third consecutive final in Rome, winning in 2008 and losing to Nadal last year.