Murray surrendered a two-set lead before eventually regrouping to prevail 6-4 6-1 4-6 1-6 6-0 in testing conditions at Roland Garros.
The Briton, who will face eight-time champion Rafael Nadal in the last four, had to compete in near-darkness in Paris, with the match finally concluding at 21:40 local time.
"It was a hard match," said Murray. "Conditions changed quite a lot during it. It was extremely windy in the beginning, and then it was pretty calm at the end and very slow.
"It was obviously very cold at the end of the match. He really raised his game in the third set.
"I thought I played a pretty good third set. The fourth set wasn't my best, but it was a fun match."
The fading light in the French capital threatened to end the match, with referee Stefan Fransson making his way on court to assess the situation in the fifth set, though he allowed play to continue.
"I didn't want to stop the match either," said the world number eight.
"I asked what the situation was. It was 21:20. I was told we had 20 minutes left, so, you could potentially play two games, two or three games in that time.
"Six was the maximum that you could play. I mean, it was so dark at the end."
Monfils said: "It was getting a bit dark, we couldn't see all that well, but I really wanted to finish tonight because I knew that he was not in great shape.
"I felt better. Maybe that's why I was a bit rushed in attacking him. I'm very frustrated."