Djokovic set up a semi-final blockbuster against old rival Nadal after both former world number one players battled back in thrilling last-eight clashes
Sharapova fired a French Open warning with an epic three-hour win over Roland Garros champion Jelena Ostapenko to reach the women's semi-finals.
Former world number one and five-time Grand Slam winner Sharapova found herself in a dogfight with her Latvian opponent.
Playing her fourth match in as many days, Sharapova needed three hours, 10 minutes to win a gruelling struggle, eventually triumphing 6-7 (6/8), 6-4, 7-5.
For Sharapova, now the world number 40, it was arguably her best victory since her return from a 15-month doping ban last year.
"It was nice to close things down in that way after a long match," three-time Rome champion Sharapova said. "I didn't have a great first set, I kept going. I like to smile about it.
"It's always nice to have a battle with a few ups and downs and finish strong to get through a match like this against a really high-quality opponent.
She added: "I appreciate this new chapter of my career, I still have lots of passion for the sport and for this life. I realise I'm towards the end of my career so I appreciate it."
Sharapova rode a roller-coaster in her marathon win, working her way from 4-1 down in the first set only to drop it in a tiebreaker after 80 minutes.
She regained her momentum to win the second set but it was tough in the third when she let a 5-2 lead get away.
With Sharapova serving for victory, Ostapenko secured a break for 4-5 thanks to a ninth Sharapova double-fault which yielded a break point.
The sixth seed then saved two Sharapova match points to level 5-5 before the Russian claimed victory two games later with a final break in a match marred by 21 cumulative double-faults and a dozen breaks of serve.
Sharapova will next face world number one Simona Halep who made sure of the top seeding at Roland Garros with a 6-2, 6-3 win over France's Caroline Garcia.
Fourth seed Elina Svitolina recovered from a slow start to defeat former number one Angelique Kerber of Germany 6-4, 6-4.
Defending champion Svitolina will next face Estonia's Anett Kontaveit who earned an upset over second seed Caroline Wozniacki, 6-3, 6-1.
Novak Djokovic set up an Italian Open semi-final blockbuster against old rival Rafael Nadal after both former world number one players battled back in thrilling last-eight clashes on Friday.
The Serb fought back against Kei Nishikori to earn a 2-6, 6-1, 6-3 win while top seed Nadal continued his clay court domination with a 4-6, 6-1, 6-2 defeat of Italy's Fabio Fognini.
On a dramatic and exhausting day in the Italian capital, there were also quarter-final wins for three-time winner Maria Sharapova and defending men's champion Alexander Zverev.
Djokovic, seeded 11th after his elbow injury problems, beat Japan's top player for the 12th time in succession.
"It was a fantastic match, we went toe-to-toe all the way to last shot. He started, he was flawless from both ends," said Djokovic who will face Nadal for the 51st time, holding a narrow 26-24 advantage.
Nadal beat Djokovic in their last meeting in May in 2017 in a Madrid semi-final and the Serb will be out for revenge after winning seven in a row prior to that.
"We will see tomorrow. I've not played so many matches in the last six months," said Djokovic whose last semi-final spot was in Eastbourne on the eve of Wimbledon in 2017.
"Physically, I'm OK. I just need some rest now and then go out and give it everything I've got."
Second-ranked Nadal needs to lift an eighth career title at the Foro Italico on Sunday to return to the top of the rankings after losing that position to Roger Federer last week.
Nadal dropped the opening set to Fognini in an hour but regrouped effortlessly as he swept past the Italian in the one-sided second and third sets.
"I'm not used to playing so early," Nadal said of his midday start. "But I'm very happy to be in the semi-finals.
"This was a very important win for me today."
Nadal also beat Fognini in Rome in 2013 in their first ever meeting. This was his 11th victory in 14 meetings with the 21st-ranked Italian, and sixth in a row.
Nadal is working towards Roland Garros, where he will aim for an unprecedented 11th title.
"My clay court season has been, I think, fantastic. It will be much better if I finish here with another title," added the 16-time Grand Slam winner.
Marin Cilic beat Pablo Carreno Busta 6-3, 6-3 to reach the Rome semi-finals for the first time where he will face second seed Zverev.
Defending champion Zverev battled past Belgium's David Goffin 6-4, 3-6, 6-3 in a quarter-final which finished just before 1 a.m.