Eighth seed Li looked well on course for her first tour title since last year's historic win at Roland Garros as she led 6-4 4-0, and despite a Sharapova revival fashioned a match point on the Russian's serve at 6-5.
But Sharapova fought her way back to force a tie-break - only for the rain to force the postponement of the match for two hours before Sharapova stepped back out to just manage to complete the job.
In the match which lasted two hours and 52 minutes, both players had their serve broken six times in an attritional encounter that will rank as one of the finest seen on the circuit so far this season.
Sharapova said the result would give her enormous confidence heading into Roland Garros, where she has reached the semi-finals twice - in 2007 and last year, where coincidentally she was beaten by Li.
Watch: Women's Final Highlights.. More Videos
Sharapova told wtatour.com: "This is a great win for me going into Roland Garros. I know the level she played there last year and the level she can play on clay - she's just a great player really.
"So this win gives me a lot of confidence. It will be nice to have a week off now, after playing three tournaments in the last four weeks. I will have time to recover both mentally and physically."
The bad weather forced the postponement of the men's final between Novak Djokovic and Rafael Nadal, which will now be played at noon tomorrow local time.
Nadal will jump back above Roger Federer to second in the world rankings if he wins the title.