Spain relinquished first place and their 66-game unbeaten run in World Cup qualifiers with defeat in Sweden.