The 38-year-old Spaniard played on tour for more than two decades and collected 22 Grand Slam titles.