Murray, who underwent career-threatening hip surgery after the Australian Open early in the year, built his match fitness back slowly through doubles action and Challenger Tour events before heading back into elite competition.
The match was befitting of the enormity of Murray's achievement as both champions pushed each other to the limit.
"Both me and Stan have had a lot of injury problems in the last couple of years and [it was] amazing to be back playing against him in a final like that," Murray said.
"I think it was a great match, Stan was playing unbelievable hitting winners from all over the court. I just managed to hang in a bit at the end of the second set and the third set was extremely close again.
I didn’t expect to be in this position at all, so I’m very, very happy. To win another tournament...I don't think any of us expected this.
Murray's chances of picking up an expected title seemed slim when Wawrinka broke in the very first service game and saved two break points in the first set going on to win it 6-3.
Those chances looked even more slim when Murray lost a service game again early in the second set, but the Scot rallied and brought the scores level at three-apiece, saving a break point courtesy of a challenge. And in the eighth game of the second set Murray stepped up to take advantage of his first set point and force a deciding third set.
At 4-4 in the third, the two three-time grand slam winners had already broke each other twice when Murray, playing his first final since beating Fernando Verdasco to lift the Dubai Championship in March 2017, saved two break points before finishing off the 3-6 6-4 6-4 win.
After a year of injury struggles and speculation that his time as a major force in the men's game may be over, victory clearly meant a great deal to Murray, who broke down in tears after match point.