Murray led by a set and 3-1 but was eventually worn down as the German played some of the best tennis of his career to claim a first win over the Wimbledon champion.
When Mayer said afterwards that he thought Murray might have been carrying an injury in the final set, it did not bode well, but the Scot returned to play his doubles tie with Nenad Zimonjic and, though they lost 7-6, 6-4 to the top seeds, Alexander Peya and Bruno Soares, he did not show any sign of distress in his back, three months after surgery.
Rather, it was a lack of match practice and conditioning that did for the world No.4, combined with a purple patch from Mayer, whose unpredictable style can make him a handful when he is on his game.
Moving well and playing solidly, Murray was in control at a set and 3-1 but lost five of the next six games as Mayer found the lines and a way back into the match. An early break in the final set put him on course and Murray could not prevent a defeat that will cost him ranking points but not his No.4 slot for the Australian Open, which begins on Monday week.
In the immediate aftermath, Murray might have been tempted to take a wildcard into next week's Sydney International to gain more matches before the first grand slam event of the year, but the 26-year- old does not like to play a regular tournament in the week before slams and is likely to request a couple of exhibition ties late next week at Kooyong, where the Australian Open was held until 1988.
There was more success yesterday for Murray's brother, Jamie, as he and the Australian John Peers edged out Kevin Anderson and Robert Lindstedt 4-6, 7-6, 14-12 to reach the semi-finals of the Brisbane International. The pair will have a day off today before their semi-final but are already clicking nicely into form.
Though Colin Fleming and Ross Hutchins were beaten first time up in Brisbane, just being there was a success for Hutchins, 12 months after he was diagnosed with Hodgkin's Lymphoma. "To be on court was something that I've thought about a lot the last 12 months," Hutchins said. "I loved every second of it."