Algeria needed a large slice of good fortune to defeat Burkina Faso 1-0 in their World Cup playoff in Blida on Tuesday to reach the 2014 finals in Brazil on the away goals rule.
The Algerians struck early in the second half through Madjid Bougherra, the ball deflecting in after Bakary Kone's attempted clearance struck him on the head, as the tie finished 3-3 on aggregate.
Burkina Faso, bidding to qualify for the first time, went agonizingly close late on when they hit the post.
Algeria join Cameroon, Ivory Coast, Ghana and Nigeria as Africa's World Cup representatives.
The Mustapha Tchaker stadium was full six hours before kickoff and the sense of expectation from the fans translated to the players as the home side made a cautious start.
Algeria had only one clear sight of goal in the first half, Islam Slimani heading wide from a Faouzi Ghoulam cross out on the left.
Lady Luck smiled on the hosts three minutes into the second period when Ghoulam's free kick was not cleared by the Burkinabe defense and the ball fell kindly for Bougherra three meters from goal.
His initial effort was saved by Daouda Diakite and as Kone tried to hook the ball away he succeeded only in blasting it against the forehead of Bougherra and it rebounded into the net.
Slimani then flashed a shot on the turn just wide as Algeria, buoyed by the jubilation in the stands, pushed forward in search of a second goal.
The remainder of the game was largely played in the Burkina Faso half but there was late drama when a corner from the visitors was deflected on to the Algeria post and bounced away to safety.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)