The American world number one served superbly to win a pulsating final 6-3 7-6 (7-5) after Sharapova fought back in the second set.
Williams, 33, moves past Martina Navratilova and Chris Evert with a 19th major singles title.
She has now beaten Russia's Sharapova, the world number two, 16 times in a row dating back to 2004.
"I have to congratulate Maria, she played a wonderful match and she really pushed me," said Williams.
"She played so well and gave me a great final not only for the fans, but for women's tennis. I'm really honoured to play her in the final."
Despite feeling so unwell during a rain delay in the first set that she left the court to vomit, Williams hit 18 aces and 38 winners as she won in one hour and 51 minutes.
Seemingly unsure for a moment that an ace had sealed victory, she then shook hands with Sharapova and bounded over to the corner of Rod Laver Arena towards her player box.
It was a brilliant performance in a final that exceeded many expectations, bearing in mind the players' head-to-head record.
Sharapova made a nervous start, double-faulting to drop serve in game one, while Williams appeared keener than ever to shorten the points, possibly because of her ailment.
The American crushed the Russian's second serve and was not disrupted by a 12-minute rain break that led to the roof being closed.
Still feeling the effects of a heavy cold that has dogged her over the last week, Williams headed off court - in contrast to Sharapova - but the top seed returned at the potentially dangerous score of 3-2, 30-30, to calmly produce an ace and a forehand winner.
Breaks of serve were swapped before Williams took the set in 47 minutes with a backhand and a scream.
Sharapova was looking at another one-sided defeat when facing break points early in the second, but showed why she is a five-time Grand Slam champion.
She served her way out of trouble and managed to cling on in a set in which Williams hit 15 aces and won almost 90% of first-serve points.
A gripping contest developed, with Serena escaping at 3-2, 0-30 thanks to three aces and a service winner.
Another game of three aces led to the American being called for hindrance after shouting "Come on" before the point had finished, and she mockingly mouthed "calm down" to herself after another winner soon after.
Latest Stories
-
‘Menstruation is not a taboo’: North Tongu DCE champions dignity and access for girls
13 minutes -
Revoking Nyaho-Tamakloe’s ‘founding member’ status likely to be considered at NPP NEC meeting – JFK
29 minutes -
Wontumi arrest: Posterity will judge you – Afenyo-Markin tells NDC
51 minutes -
Wontumi arrest: JFK condemns Dr. Nyaho-Tamakloe’s ‘Where is NPP Chairman’ comments
56 minutes -
Bawumia calls for calm amid Wontumi’s detention
1 hour -
Two dead, others injured in Juaso-Nkawkaw Highway crash
1 hour -
We’re disappointed we didn’t see Wontumi – Dr Bawumia
1 hour -
GH₵50m bail deliberately set to block Wontumi’s release – Bawumia
1 hour -
Ashanti Peace Council urges stakeholders to uphold law and protect national peace
2 hours -
Equipping future healthcare professionals: Cassona Global, Mindray provide free practical training for ATU students
2 hours -
Bawumia, Minority Leader, granted access to Wontumi as tensions mount over detention
2 hours -
World Menstrual Hygiene Day: Terry Yegbe Foundation and Groomdatgirl champion menstrual health education at Horti EP Primary
2 hours -
Watch how Bawumia was forced through violent scuffle as NPP supporters clash with Police
2 hours -
NPP currently has no leadership; where is the Chairman? – Nyaho-Nyaho Tamakloe quizzes over Wontumi arrest
2 hours -
Tensions rise as NPP supporters besiege NIB headquarters over Wontumi’s transfer
2 hours