Australian Minjee Lee was third on 14-under. The 22-year-old American secured her second victory of the year although it would have won more if she hadn't lost in all three appearances in play-offs in 2017.
It represented a significant return to form for Ko, 20, who hasn't won for 14 months and whose world ranking has slipped to eighth.
Her putting at times resembled that of the golfer who had dominated the women's game for more than two years.
And her driving also made strides this week, recording birdies on 10 of the 12 par-five holes she played this week.
She played with a smile on Saturday, even when victory appeared to be slipping from her. Before the round, she spoke of an improved mental state after missing the cut in two of her last three tournaments.
"I've just kind of enjoyed being in this position and being able to hit some good shots and give myself some good looks at birdie," Ko said.
When you start doing that, it builds your confidence and you're not dwelling on, 'Hey, am I going to hit a good shot or a bad shot.' I think that's kind of the mindset that I've kind of gotten into the last few months."
Ko will contest the year's final major, the Evian Championship, in France next week. She then begins preparations for the New Zealand Women's Open in Auckland starting on September 28, when it makes its debut on the LPGA Tour.