Williams joins Steffi Graf as a five-time winner in Miami
Defending champion Serena Williams overcame an attack of nerves to see off Serbia's Jelena Jankovic and win the Sony Ericsson Open for the fifth time.
The American, 26, beat the fourth seed 6-1 5-7 6-3 in two hours 25 minutes.
Williams was in total control early on, winning eight straight games, but was broken to love serving for the match.
Jankovic, 23, took advantage to level thanks to a Williams double-fault, but the American eventually came through with three breaks in the decider.
"I was definitely up and on my way to glory within an hour, but I started making a lot of mistakes, and Jelena obviously started playing better too," said Williams, who needed eight match points.
"Players who have nothing to lose are the most dangerous people in life on the court. I thought I had like 15 match points; I'm glad to know it wasn't. It was weird."
The fact I got tight today is definitely a reflection of my desire and dedication level
Jankovic said: "I tried to come back. I tried to fight. I thought Serena really had trouble closing out the match but she was very strong.
"When she's playing her best tennis, when she's serving well, it's just tough to match up against her.
"Even though I work hard physically, I can never in my life be as strong as her. She was the better one today."
Williams was totally dominant in the early stages, both on serve and with some fierce returning.
The first break came in game four and the next seven games went by in a blur of winners from the eight-time Grand Slam champion.
Jankovic, suffering with a cough throughout, looked set for a total humiliation until she unexpectedly stopped the rot with a break of her own, to love, to go 3-1 down in the second.
It halted the American's momentum, and the ever-smiling Jankovic enjoyed the sympathy of the crowd, but Williams remained in charge.
She kept the increasingly competitive Jankovic in check until serving for the match, at which point the nerves gripped her.
Jankovic took it to love, came through an epic following game from 0-40 to hold serve, and then took the set when Williams double-faulted.
But the four-time champion managed to regain the initiative with a break at the start of the final set, by which time the fierce heat was taking its toll.
No stranger to medical timeouts, Jankovic had struggled with back pain throughout the tournament and needed the trainer again in the third set as she complained of a headache and feeling light-headed.
And an angry outburst from the Serb directed towards the crowd soon afterwards did not help win her any more support as she struggled on.
Two more breaks of serve followed for Williams and she needed the breathing space.
It was really annoying for me to be sick and playing a final
She failed to serve out the match twice more, smashing her racquet and hurling it across the court after letting a 40-0 lead slip when serving at 5-2.
If Williams was going to win it would surely be when receiving serve, and so it proved in the following game as she finally converted her eighth match point with a smash, letting out a scream of pure relief.
The victory made up for Williams' only loss in 15 matches this season - a defeat by Jankovic in the Australian Open quarter-finals.
"It was really annoying for me to be sick and playing a final," said Jankovic.
"I felt a little bit weak today. I couldn't breathe. I tried just to play the game and just enjoy it and have fun."
Williams also won the Miami title in 2002, 2003, 2004 and 2007, and equals Steffi Graf as a five-time winner of the tournament.
"I feel like all I want to do is play tennis, be the best and win," she said.
"My whole life is dedicated to nothing but tennis. I've been working really hard.
"Sometimes when it doesn't come together I get frustrated, and the fact I got tight today is definitely a reflection of my desire and dedication level."