The Chinese star first tumbled to the court after twisting her left ankle in the fifth game of the second set and had it taped.
On the first point after a 10-minute pause in the third set while fireworks boomed overhead from nearby Australia Day celebrations, Li fell over again and slammed the back of her head on the court. The 2011 French Open champion was treated and had another timeout before being allowed to resume the match.
Azarenka, who broke down in tears and sobbed into her towel when the match ended, won five of the next six games to claim her second major title and retain the No. 1 ranking.
"Unfortunately, you have to go through some rough patches to achieve great things. That's what makes it so special for me," she said. "I went through that, and I'm still able to kiss that beautiful trophy."
Serena Williams, who lost in the quarterfinals, will become the new No. 2 in the rankings.
Americans Mike and Bob Bryan won their record 13th Grand Slam doubles title, defeating the Dutch team of Robin Haase and Igor Sijsling 6-3, 6-4. They had been tied with the Australian greats John Newcombe and Tony Roche with 12 major titles.
The women's 2-hour, 40-minute match featured 16 service breaks, with Li losing her service nine times.
On a crisp Saturday night, Azarenka won the coin toss and elected to receive, a ploy that seemed to work when a nervous Li was broken to start the match. After a double fault on the first point, Li's forehand long gave Azarenka the early lead.
When she first injured her ankle, Li was trailing 3-1 in the second set. When she came back, she won three of the next four games to tie it 4-4, but Azarenka broke back and then held her serve.
Azarenka broke in the opening game of the final set, just two games before the match was suspended for the fireworks, a planned stoppage of play that both players were notified about before the match.
While Azarenka jogged around and practiced her serving motion during the 10-minute fireworks break, Li sat on her courtside chair for most of the stoppage.
It was on the first point that she again fell to the court.
Li said she went "totally black" for two seconds after her head hit the court, and when a medical official asked her to follow her finger, "I started laughing, thinking 'This is a tennis court, not like a hospital.' "
Li said the tournament doctor saw her after the match and checked out her head and neck.
"I should be OK,' Li said.
From the outset, the capacity crowd at Rod Laver Arena was firmly behind Li, cheering loudly when she was introduced. Meanwhile, Azarenka's errors were applauded, and one spectator even mocked the loud hooting sound she makes when she hits a shot.
The chill from the crowd was a remnant of Azarenka's semifinal win over American teenager Sloane Stephens, when Azarenka was criticized for taking a questionable 10-minute medical timeout near the end of the match. She was accused of taking the time to compose herself after she'd wasted five match points while serving for the match against Stephens. Azarenka said she needed the time out because a rib injury was making it difficult for her to breathe and she had a knee injury.
In the second set Saturday, a few fans heckled Azarenka. One man yelled, "Take a deep breath, Vicky."
By the end of the match, she appeared to have won some of the fans back. Azarenka's friend, rapper Redfoo, yelled down to her from the player box "You deserve it," and she later blew kisses to the crowd. Someone else in the crowd shouted "Victoria, we love you."
Azarekna appeared to quickly forgive the crowd, saying during the trophy presentations that she wanted to thank the fans for their support.
"I will always keep very special memories of this court and it will be in my heart forever," she said, pausing several times to find the right words. "Of course, I (almost) forgot to say congratulations to Li Na, she's had a terrific start to the year ... hope to see you in many, many more finals."
Later, Azarenka said she expected a "way worse" reception from the crowd.
"You just have to go out there and try to play tennis in the end of the day," she said. "The things what happened in the past, I did the best thing I could to explain, to do everything I could, and it was left behind me already."
Azarenka and Li had met twice before in Grand Slam tournaments, with Li winning both times — in the fourth round of the 2011 Australian Open and quarterfinals at the French Open. Li lost the 2011 Australian Open final to Kim Clijsters but won her first Grand Slam title at Roland Garros a few months later, beating Francesca Schiavone.