Updated

Rasmus Elm scored on the final play of the game Tuesday as Sweden completed a remarkable four-goal rally to draw Germany, 4-4, at Olympic Stadium in UEFA qualifying for the 2014 World Cup.

Across the continent, defending World Cup and two-time defending Euro champion Spain was also stunned by a last-second goal at home, as Olivier Giroud headed in the tying goal on the final play to give France a 1-1 draw in Madrid.

Sweden stole some of the spotlight from the marquee match in Spain, as it came back from four goals down after the hour mark against Germany.

Miroslav Klose had a pair of goals inside 15 minutes to up his career total to 67, one shy of Gerd Muller for the most in German history, and Per Mertesacker added his first on the international level in the 39th.

Mesut Ozil added a fourth in the 56th minute, but Sweden started its rally six minutes later when Zlatan Ibrahimovic headed inside the left post.

Mikael Lustig slipped a shot just inside the right post off Germany goalkeeper Manuel Neuer two minutes later, and Johan Elmander cut the deficit to one goal in the 76th with a finish to the bottom-right corner.

Sweden almost tied the game five minutes from time when Neuer spilled the ball on the edge of the area only to be bailed out when Tobias Sana missed an open net, but Elm was not as kind in stoppage time.

Elm was in the right place when a cross deflected off Mertesacker and fell to him in the middle of the area, and he converted from 12 yards to stun Germany.

Germany still leads Group C with 10 points, but has played one more match than Sweden, which is three points back in second place.

Ireland is third in Group C on six points after a 4-1 victory over the Faroe Islands, and Austria used a Marc Janko brace to thump Kazakhstan, 4-0, for its first win.

Spain also maintained the top place in Group I, but only on goal differential over France. Spain and France are both on seven points after three matches.

Sergio Ramos put Spain ahead in the 25th when he scored from close range, and after Jeremy Menez had a goal called back for a questionable offside call, the hosts earned a PK for a chance to put the French away.

French goalkeeper Hugo Lloris saved the penalty from Cesc Fabregas in the 41st to keep the deficit at one, and the equalizer came at the death when Franck Ribery sent a cross to Giroud, who headed from 12 yards to the right post.

Spain had won its last 24 qualifying matches.

Also in Group I, Renan Bressan and Stanislav Dragun scored as Belarus defeated Georgia, 2-0, for its first qualifying win.

Riccardo Montolivo and Daniele De Rossi scored four minutes apart in the first half and Mario Balotelli added a third after halftime as Italy stayed unbeaten with a 3-1 win over Denmark in Group B.

Italy has three wins and a draw from four fixtures to build a four-point lead over Bulgaria, which settled for a 0-0 draw against the Czech Republic.

In Group A, Christian Benteke and Vincent Kompany scored two minutes apart in the second half as Belgium defeated Scotland, 2-0, Mario Mandzukic and Eduardo scored as Croatia beat Wales, 2-0, and Macedonia edged Serbia, 1-0.

In Group D, Rafael Van der Vaart and Robin Van Persie were among the scorers as the Netherlands opened a three-point lead with a commanding 4-1 win against previously unbeaten Romania, Hungary remained within three of the Dutch with a 3-1 win over Turkey, and Estonia edged Andorra, 1-0.

In Group E, Tranquillo Barnetta and Mario Gavranovic scored as Switzerland was able to maintain a three-point lead atop the standings with a 2-0 win against Iceland, Norway scored two late goals to defeat Cyprus, 3-1, and Albania edged Slovenia, 1-0.

In Group F, Roman Shirokov converted a penalty six minutes from time as Russia maintained its perfect qualifying mark with a 1-0 win over Azerbaijan to stay atop the group, Portugal needed a 79th-minute goal from Helder Postiga to draw Northern Ireland, 1-1, at home, and Tomer Hemad scored twice as Israel toppled Luxembourg, 3-0.

In Group G, Vedad Ibisevic, Edin Dzeko and Miralem Pjanic scored as Bosnia- Herzegovina defeated Lithuania, 3-0, to remain even on 10 points at the top of the group with Greece, which used a goal from Dimitris Salpingidis to defeat Slovakia, 1-0. Latvia beat Liechtenstein, 2-0, in the group's other match.

In Group H, England and Poland were postponed until Wednesday because of heavy rain and a waterlogged pitch, Dejan Damjanovic scored to give Montenegro a 1-0 win over Ukraine, and Moldova defeated San Marino, 2-0.