On a dramatic night that completed the list of European qualifiers for next year's World Cup, France stormed back from a two-goal deficit to earn a place in Brazil while Cristiano Ronaldo almost single-handly took Portugal through with a stunning hat-trick.
France faced an uphill task in Paris after losing the first leg in Ukraine 2-0 on Friday. Yet the visitors' advantage had been wiped out after just over half an hour, first Liverpool defender Mamadou Sakho scoring from close range when Franck Ribéry's shot was palmed straight to him by Ukraine goalkeeper Andrei Pyatov, then Karim Benzema turning in Yohan Cabaye's miscued shot from a clearly offside position.
Benzema, who had received a lot of criticism for his goalless run for Les Bleus earlier this year, had a more legitimate strike ruled out for offside several minutes beforehand.
Ukraine were really up against it when Yevhen Khacheridi was sent off after picking up his second booking for fouling Ribéry just after half-time. Roman Zozulya missed a good chance to put them back in front on aggregate before with 16 minutes to go, Ribéry crossed and Oleg Gusev turned the ball into his own net under pressure from Sakho.
"It's the magic of football. Four days ago we were bad, very bad," the France coach Didier Deschamps said afterwards as a delirious Stade de France celebrated.
The final aggregate score in the Portugal versus Sweden tie was Ronaldo four Zlatan Ibrahimovic two after a pulsating game in Stockholm.
Ronaldo's late header had given Portugal a 1-0 advantage in the first leg and his breakaway goal five minutes into the second half looked to have clinched victory. Yet two goals from Ibrahimovic in the space of four minutes, one a header from a corner, the other a ferocious free-kick from the edge of the penalty area, brought Sweden right back into it.
The Swedes still needed another goal to avoid defeat on away goals and left themselves open to counter-attacks, Ronaldo twice picking off a stretched defence to incredibly get his third hat-trick in six games and send Portugal through 4-2.
Croatia ended Iceland's dream of becoming the smallest country to reach the World Cup finals with a 2-0 win in Zagreb. After a goalless first leg, the Bayern Munich striker Mario Mandzukic swung the tie the home side's way by turning in a deflected cross from close range in the 27th minute.
Mandzukic was sent off for a horrible, studs-up foul on Johann Gudmundsson 11 minutes later but Iceland could not capitalise on the man-advantage and there was no way back when Darijo Srna cut in from the right to score Croatia's second just after half time.
Konstantinos Mitroglou continued his superb start to the season to ease Greece's progress to Brazil. Mitroglou, who scored twice in the Greeks' 3-1 first-leg win over Romania and has been linked with a move to the Premier League, eased any nerves Fernando Santos' side might have felt in Bucharest when he beat the offside trap in the 23rd minute to fire home his 22nd goal of the season.
A bizarre own goal 10 minutes into the second half gave Romania some hope, Vasilis Torosidis colliding with team-mate Jose Holebas and inadvertently striking the ball beyond goalkeeper Orestis Karnezis from the edge of the penalty area. However Greece held on to go through 4-2 on aggregate.
In the African play-offs, Ghana, who reached the quarter-finals in 2010, secured their place despite losing 2-1 to Egypt in Cairo, the Black Stars going through 7-3 on aggregate. Egypt have not appeared at the World Cup since Italia '90 despite winning four African Cup of Nations titles in the same period.
Burkina Faso were denied their first appearance at a World Cup finals in cruel fashion when they went out on away goals rule after drawing 3-3 on aggregate with Algeria. The home side got the 1-0 win they needed when Bakary Koné's clearance hit former Rangers defender Madjid Bougherra on the head and went in just after half time.
World Cup qualifiers: From Europe and Africa
Europe and Africa both completed their contingents for next summer's World Cup finals:
Qualifiers from Europe
Belgium, Bosnia and Herzegovina, England, Germany, Italy, Netherlands, Russia, Spain, Switzerland, France, Greece, Croatia, Portugal
Qualifiers from Africa
Algeria, Cameroon, Ghana, Ivory Coast, Nigeria
Draw takes place on 6 Dec