Northern Ireland held on to top spot in their Euro 2008 qualifying group, but are set to be overtaken by Sweden once Uefa ratifies their win over Denmark.
Fandel takes evasive action in the Denmark-Sweden match
The Scandinavian derby was abandoned with the scores level at 3-3 after a supporter attacked the referee.
And Uefa could yet decide to award a 3-0 win to the Swedes, depending on the referee's and delegate's reports.
Spain moved to within a point of Northern Ireland with goals from David Villa and Xavi in a 2-0 win in Latvia.
"We were by far the better side, but the problem is that these sides sit back and defend in numbers so they are often hard to break down," said Spain coach Luis Aragones.
"It was really hard to score, but when we finally did it was easier to take control of the match."
The result means Spain are a point off top spot, having played the same number of games as Northern Ireland, and level with Sweden.
However, that could all change depending on the Uefa verdict on the action in Copenhagen when referee Herbert Fandel abandoned the match with 89 minutes on the clock.
Iceland remain bottom of the group after an embarrassing 1-1 home draw with Liechtenstein, despite Reading's Brynjar Gunnarsson heading them into a first-half lead.
Liechtenstein face Spain on Wednesday night, while Sweden host Iceland and Denmark travel to Latvia.
Northern Ireland's next match, which will be Nigel Worthington's first in charge, is against Liechtenstein on 22 August.