AMELIA ISLAND, Fla. — Maria Sharapova got the clay-court test she was looking for, but she almost got more than she bargained for.

Sharapova outlasted clay-court veteran Anabel Medina Garrigues in three sets over 3 1/2 hours at the Bausch & Lomb Championships on Thursday.

The top seed rallied from 3-0 down in the third set and survived 7-6 (3), 5-7, 7-6 (1) to move into the quarterfinals.

Three-time Bausch & Lomb champion Lindsay Davenport beat Karolina Sprem 6-4, 3-6, 6-4 in the first night match.