Andy Murray survived a near four-hour epic against Spain's Feliciano Lopez to reach the fourth round of the US Open in sweltering conditions in New York.

The third seed has a great record against Lopez but this match was tight from the start and Murray looked in trouble in the fourth set as he began to struggle in the heat.

But he hung tough and eventually edged his third tie-break of the match to come through 7-6 (7/5) 7-6 (7/5) 4-6 7-6 (7/4) and set up a last-16 clash with either Milos Raonic or James Blake.

Murray said: "It was a very, very tough match. I just had to keep fighting. It was very hot and humid in the middle part of the match and I was struggling a little bit with that. But I thought we played some good tennis, especially at the end of the sets."

The Scot prides himself on being one of the fittest players on tour but he admitted playing at the Olympics, which denied him the chance to train in hot conditions, was having an effect.

Murray suffered with cramp in his first-round win over Alex Bogomolov despite it being straight sets, and he said: "Physically I'd like to be in slightly better form but these matches help with that.

"Normally after Wimbledon I have three weeks in Miami to help with this but I didn't get that because of the Olympics. But it's a nice problem to have, that's for sure.

"It's the first couple of matches I've played in this heat and humidity for a while so it's been tough."