Spain suffered their first defeat in a World Cup qualifier since 1993 after losing 2-1 to Sweden.