Stanford, who eagled the 15th but then double-bogeyed the short 16th in a roller coaster round, thought she had lost her chance of victory when she failed to make birdie at the 18th.
But Amy Olson, the third round leader, took a double-bogey six at the 18th, hitting her tee shot into rough and then three-putting. It was the first time all day that the 26-year-old American fell out of the top spot.
An emotional Stanford couldn't hold back the tears after her first victory in one of the women's majors.
"I really don't know what has just happened," was her immediate reaction. "But I am so happy."
"Sometimes things just catch you off guard. Just when you think you're done then this happens. It's pretty cool.
"As for the finish, I know I can do stupid stuff, but I am also a fighter. This is really unbelievable." Thailand's Ariya Jutanugarn, the US Women's Open Champion, collected the Annika Rolex Major Award for season's best results over the five major championships.
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)