Hampton, 23, who received treatment on a lower back injury midway through the match, won the second set and troubled the world number one early in the decider, before Azarenka eventually prevailed 6-4 4-6 6-2.
"She played incredible," said Azarenka. "She went for every shot, she has a great future ahead of her.
"She took a medical timeout, but then she was ripping winners all over the place and I was like, 'Can I have a back problem? I'm feeling great, but I'm missing every shot.'"
Hampton has yet to win a WTA title and is ranked 63rd in the world.