The Spanish world number two, chasing his first tournament win of the season, needed almost three hours to defeat Tsonga 6-2, 5-7, 6-4 in a quarter-final night match.
Nadal struggled at times on his serve, failing to land a single ace, but he managed to save eight of 10 break point opportunities.
He served for the match at 5-4 in the second set but Tsonga dug deep, winning three straight games to force a decider.
Nadal, 25, who has reached the final in Miami three times, broke the Frenchman in the ninth game of the third to lead 5-4 and survived two break points in the final game to progress to the semi-finals.
Earlier, 2009 champion Murray, chasing his second title of the season after a win in Brisbane, rallied to beat Serb ninth seed Janko Tipsarevic 4-6, 6-3, 6-4.
The Scottish fourth seed lost his opener at Indian Wells earlier this month and he looked as if he could be headed for another early exit when he lost six games in a row.
"I felt like in the first set I was trying to do too much with the ball and therefore making more mistakes than I needed to or that I normally do," the 24-year-old said.
Murray called for the doctor in the first set when he was ahead 3-2, saying he had an upset stomach and he might have been suffering from indigestion.
"I don't know if I drunk too much beforehand and kind of over-hydrated," he said. "Each time I took a sip I wanted to burp.
"I took two tablets (from the doctor). He said it was to settle my stomach down. Basically the last two sets I hardly drunk anything."
Tipsarevic fell behind 2-4 before winning six straight games—four to win the first set and two more for a 2-0 lead in the second.
But Murray rallied to win the second set and converted a lone service break in the final set to take the match in two hours 39 minutes.
"You can take chances but you have to wait for the right ball to move on. I was rushing and trying to end points quickly and in today's game it is pretty much impossible to win playing that way," Murray said.
"Today's match was really important for me to get through after being a break down a few times in the second set," Murray said. "It is good to be in the semi-finals and hopefully I can rest, recover and play well on Friday."
Tipsarevic fired seven aces but won just 32 per cent of his second-serve points.
Besides winning in Brisbanethis year, Murray also finished runner-up to Roger Federer in Dubai and lost a five-set thriller to Novak Djokovic in the semi-finals of the Australian Open.
(For more sports news and updates, follow Ahram Online Sports on Twitter: @AO Sports)