The world No.3, competing in a tournament for the first time since winning the US Open last month, took control early but had to battle to win 6-2, 3-6, 6-2 as Wawrinka pushed him.
The Scot looked to be in total control in the opening set, grabbing two breaks, which were enough as Wawrinka wasted the opportunities which came his way.
However, he was more ruthless in the second as his big forehand started to catch the lines.
Wawrinka's first chance to edge ahead came with Murray serving at 1-2 and, despite saving two break points, Murray was unable to stave off a third as Wawrinka powered in another big forehand.
The Scot almost replied instantly but Wawrinka held on thanks to some big serving and then ran through the rest of the set without trouble.
The match hinged on the fourth game of the final set with a combination of brilliance and fortune giving Murray a break and a 3-1 lead.
He saw three break points come and go as Wawrinka raised his aggression levels to serve his way out of danger.
However, the Swiss was powerless when Murray set up a fourth as a forehand return struck the top of the net before dropping over.
Wawrinka's frustration was evident as he smashed a racket early in the next game but he could not channel it into a comeback and Murray broke again to wrap up the match in two hours and a minute.
Now he plays against big-hitting Canadian Milos Raonic, who earlier beat Janko Tipsarevic in three sets.