Murray had to raise his game as Mayer forced a third set
Andy Murray booked his place in the Valencia Open quarter-finals after winning a testing encounter against Argentine Leonardo Mayer 6-4 3-6 6-3.
Top seed Murray, 22, took the first set but Mayer, ranked 60 places below the Scot, fought back in the second.
Trailing 0-4 at one point, Murray hauled it back to 2-5, but Mayer held his nerve to level the match.
However, Murray broke Mayer in the sixth game of the decider to set up a clash with Albert Montanes on Friday.
Murray, who confirmed this week that he has signed a five-year deal with adidas from 2010, is still playing his way back into form after a wrist injury.
And the Scot complained of cold on-court conditions at the new venue in Valencia, which is making its ATP World Tour debut this week.
"I couldn't believe it, it was absolutely freezing," he told The Guardian. "There was a draft from one of the ends and when he took a toilet break [after the first set], it was so cold.
"I said to the umpire at the start of the match: 'What's going on?' It was freezing. For an indoor tournament, it was the coldest I've ever played on the tour."
Montanes progressed after compatriot and defending champion David Ferrer withdrew before their second-round match with a hamstring injury.
Second seed Nikolay Davydenko also made the quarter-finals with a 6-3 7-5 victory over world number 30 Juan Monaco.
Tommy Robredo fought back to overcome Feliciano Lopez 4-6 6-3 6-4, and Fernando Verdasco beat Serbian Janko Tipsarevic 6-3 6-3.
Davydenko and Verdasco hope to boost their hopes of booking a place at the ATP World Tour Finals in London, as the pair currently stand seventh and eighth in the standings.
Novak Djokovic, Roger Federer, Rafael Nadal, Murray, Juan Martin del Potro and Andy Roddick have already qualified for the elite eight-man tournament at the O2 Arena from 22-29 November.
In the Swiss Indoors in Basle, Djokovic made it into the quarter-finals after beating 59th-ranked Jan Hernych 6-0 6-0 in just 52 minutes.
Evgeny Korolev will face Federer after defeating Jeremy Chardy, while Marco Chiudinelli is also through after a two-set victory over Michael Lammer.
Croatia's Marin Cilic also made it into the last eight, beating Serb Victor Troicki in a close-fought match settled by three tie-breaks, 7-6 (9-7) 6-7 (8-10) 7-6 (8-6)
Richard Gasquet of France overcame American John Isner 4-6 7-6 (11-9) 6-2, and Stanislas Wawrinka beat Jarkko Nieminen 7-5 2-6 6-1.