But Sharapova's nerve soon returned as she took an early lead in the tie-break which she never relinquished to seal a win over the Czech who beat her in last year's Wimbledon final.
Agassi showed his class to break Henman again, and in the tie-break the Briton spurned four match points before the American held his nerve to seal the match.
But Safin did not have to stretch himself much to seal the set, Lopez making a string of unforced errors to lose the tie-break 7-1 and fall 2-1 behind in sets.
After dominating the first set, two stunning winners - a backhand down the line and crosscourt forehand winner - saw the two-time semi-finalist, whose only Grand Slam title came at the 2005 US Open, break to love to seal it and she opened the second with a confident hold.