The Russian eighth seed, who also claimed a third straight victory last month in Stuttgart, improved to 3-0 over Romanian fourth seed Halep and 16-4 at the event where she lost the final a year ago to Serena Williams.
Sharapova will rise to seventh in the rankings as a result of her 31st career trophy. Eight of her last 10 titles have come on clay, but this is the first time she has triumphed in the Spanish capital.
The four-time Grand Slam winner was looking dismayed after going down in the opener in just 29 minutes to her Romanian opponent who has made a huge improvement since appearing as a wild card at the same event in 2013.
"I don't take these moments for granted because I know what it's like to be out and injured and trying to find your way back just to play tennis," said Sharapova.
"I really enjoy playing this sport. I like the work that I put in, and I want to get the opportunities to be in the final. So it doesn't matter if I'm playing on the moon or in Madrid, to be in the final position is an honour.
"I want to take my chance as much as I can, so of course I'm so happy to win a tournament. I came so close last year. I had a tough 2013 (due to a shoulder injury). I didn't have a great first set, so I really had to work to win. I'm not sure how I pulled it out."
The victory was her ninth career trophy on clay.
Sharapova needed a chat with coach Sven Groeneveld after dropping the first set in dispiriting fashion, but the proven champion quickly got to work turning the momentum her way, beginning the second set with a break of serve.
She reached 5-2 as Halep began to feel the pressure and levelled at a set each when the Romanian hit the net with a backhand.
Sharapova continued her revival in the third set, overcoming a brief wobble as she lost serve to love while leading 4-1.
Concentration proved key, with the Russian taking victory three games later on her first match point.
Sharapova has now won 11 straight matches as she heads to Rome for next week's last event prior to the French Open, which starts on May 25th.
Halep was pleased with her own showing despite taking the loss.
"I was a little bit tired today, but this final, it's like a victory for me," said the Romanian.
"This tournament is very big and it for me it means a lot. It's very special. I learned many things here, and for the next time for sure I will manage the situation better."