The seventh seed from Russia claimed her fifth grand slam title after Wimbledon 2004, the 2006 US Open, the 2008 Australian Open and her first Roland Garros title two years ago.
Halep, who had not lost a set entering the final, put up a great fight but bowed out after three hours and two minutes - the longest women's final in Paris since 1996.
Sharapova wrapped it up on her first match point when Halep could not return one of her opponent's sizzling forehands.
"This is the toughest grand slam final I have ever played. I respect Simona a lot, I thought she played an unbelievable match today," Sharapova said with smudged mascara under her eyes.
"I can't believe it, seven or eight years ago I would not have thought that I would win more Roland Garros than any other grand slam.
"To think I won it twice... I'm so emotional now I can't talk."
The wily Romanian had forced a decider just as Sharapova seemed to have ended her resistance.
The Russian, however, had won the last 19 three-set matches she had played on clay since losing to Justine Henin in the third round at Roland Garros in 2010 and made it 20 with a characteristically gutsy display.
Halep, hoping to become the second Romanian woman to win a grand slam title after her manager Virginia Ruzici won at Roland Garros in 1978, broke in the first game of the match when Sharapova sent a backhand long despite having an open court at her disposal.
Sharapova unsettled Halep with her crosscourt shots but the Romanian held on for 2-0.
The Russian bombarded Halep with powerful forehands and managed to break back for 2-2 on her fourth chance when Halep's crosscourt backhand went wide.
Sharapova's third double fault gave Halep another break point, which the Russian saved with another forehand winner down the line before holding for 3-2 after four deuces.
The Russian broke for 4-2, went to 5-2 and then lost two games before taking the set on her opponent's serve when Halep fired a crosscourt forehand wide.
Sharapova won the first game of the second set to love and broke in the second with the contest seemingly heading for a swift conclusion.
Halep would not give up, however, and broke back by forcing Sharapova to net a backhand as the crowd roared "Simona, Simona".
They exchanged four breaks in a row as the set went into a tiebreak and the clock ticked past the two-hour mark. Halep went 5-3 down but then scored four points in a row to send the match into a deciding set.
Sharapova saw off two break points in a hotly contested fourth game and went on to break Halep's serve screaming "Davai!" (come on), only to double fault yet again as the Romanian levelled for 4-4.
In a third set where the serve counted for little, Sharapova broke to love to move one service game from the title and fell to her knees in celebration as Halep sent a looping backhand wide.
"It's my first grand slam page, emotionally it's difficult," said Halep, last year's most improved player.
"I hope there will be many more but this one will be special for me all my life. Congrats Maria you're a great champion."