The 30-year-old had been a hot favourite to beat world number one Victoria Azarenka after her victories at Wimbledon and the Olympics but she was pushed all the way, fighting back from 5-3 down in the decider to win 6-2 2-6 7-5.
Williams looked stunned as she absorbed her achievement, which brought a fourth title at Flushing Meadows and very different headlines to the ones she has written in New York over the past few years.
In 2009, the world number four lost to Kim Clijsters in the semi-final after receiving a point penalty for abusing a lineswoman, then last year she was beaten by Sam Stosur in the final after again losing her cool, this time with umpire Eva Asderaki.
Meanwhile, earlier last year, Williams feared not just her career but her life was in danger when she suffered from blood clots on her lungs as a result of a foot injury that kept her out of the game for a year.
It has been a remarkable period for Williams, and she said: "I don't think about the downs too much. I hope I never think about them as my life continues.
"But I really think a champion is defined not by their wins but by how they can recover when they fall. I have fallen several times.
"Each time I just get up and I dust myself off and I pray and I'm able to do better or I'm able to get back to the level that I want to be on.
"So I feel really awesome that I have been able to do that and that I can do that.
"You see great people like Muhammad Ali, who is a complete person I have always looked up to in sports. I just really think that defines a champion."
Watch: Serena wins US Open title... More Videos
Speaking on court after the match, Williams joked that she had been preparing her runners-up speech, and she said: "Obviously I would have wanted to win easy.
"But, at the same time, this is more exciting to win because you don't really know what's coming. You don't know what to expect, and then you get it. This is the best feeling I think in tennis.
"To cap off the gold medal and then to come from the gold medal to win US Open is unforgettable. I'm really so excited."
It was the first three-set women's final in New York for 17 years, and it was one of the best grand slam finals for a long time.
It did not look that way when Williams blasted her way through the first set in little more than half and hour but she made errors at the start of the second and that gave Azarenka an opening.
The Belarusian is a renowned fighter and she grabbed her chance, and in the decider it really looked like the Australian Open champion would cause a shock.
Williams was mixing winners with errors and Azarenka battled into a 5-3 lead, but the American, who won her first title in New York 13 years ago, was not done.
She produced some trademark huge serving to hold and then broke the world number one as finally the occasion caught up with Azarenka.
It was largely down to the force of will of Williams, though, and it was no surprise when she clinched a fourth straight game to claim another slam title.
Azarenka sobbed into her towel at the end but was content that she had given absolutely everything.
The 23-year-old said: "I think it was a great match. Being so close it hurts deeply to know you don't have it, you're close, you didn't get it.
"But, at this moment, I have no regrets. I felt like I gave it all. Could it have gone my way? Probably, yes. But it didn't. It really, really hurts.
"Those emotions come out and you feel sad, but it's time to really realise what happened today. It was close but not for me."
The two players are good friends and Azarenka graciously accepted the better player had won despite being so close to victory herself.
She said of Williams: "For me, she's the greatest player of all time. She took the game to the next level.
"She makes me all the time make sure that I'm taking my game, my personality, my physical aspect to the next level. So having a few of the players like that on the women's tour right now is something priceless, something that you cannot take away."