Algeria booked a first trip to the World Cup in 24 years by beating Egypt 1-0 in a tense play-off in Sudan.
Centre-back Antar Yahia settled the contest with a stunning first-half volley at an angle eight yards out from Karim Ziani's punt into the box.
Rookie goalkeeper Fawzi Chaouchi was the night's other hero as he constantly denied the six-time African champions.
The two were forced to go to the one-off play-off in Khartoum after finishing level in Group C.
Algeria become the sixth African team at the finals, joining fellow qualifiers Ghana, Ivory Coast, Cameroon, Nigeria and hosts South Africa.
The two sides needed the play-off after Egypt's 2-0 win over Algeria on Saturday left the pair inseparable at the top of their group - with the same points, the same goal difference, the same number of goals scored and the same head-to-head record.
The triumph is also a personal victory for Algeria coach Rabah Saadane, who was at the helm when Algeria last reached the finals in 1986, while their first appearance was four years earlier.
The veteran coach strangled the game late on when throwing on the defenders as the Fennecs held on for a famous victory.
Reaching South Africa had been a long-held mission for Egypt, who last qualified for the 1990 World Cup, yet a lacklustre display means they miss the continent's first World Cup.
After some pushing and shoving marred the early exchanges, Yahia was the first to properly threaten at a free-kick but was denied by some expert defending.
Indicating the game's pressurised atmosphere, three players were booked inside the first half-hour as emotions bubbled near the surface.
Algerian fans are celebrating reaching the 2010 World Cup finals
Just after the half-hour, Mohamed Aboutrika fired a volley wide from the edge of the area before Chaouchi dived low to his right to superbly deny Ahmed El Muhammadi.
Then, after 40 minutes, a free-kick punted forward dropped over everyone's heads to the back post where Yahia wonderfully cracked home his effort off the underside of the bar, a goal fit to win any game.
In the second half the Pharaohs too often resorted to the long ball, replacing their traditional build-up along the floor, playing into the hands of a magnificent Algerian defence.
Early in the second half, Zaher El Said wasted a good chance for the Egyptians, heading from 10 yards when unmarked at a free-kick.
It was end-to-end just after the hour as Rafik Saifi headed Hassan Yebda's fine cross straight at Egypt keeper Essam Al Hadary, before the Pharaohs' best move of the match ended with Chaouchi diving low to save after a neat turn and shot from Emad Moteab, Saturday's key goalscorer in Cairo.
Then 18 minutes from time, 23-year-old Chaouchi - only playing in place of suspended stopper Lounes Gaouaoui - denied the Egyptians again on an unforgettable night for a man winning his third cap.
The victory will spark huge celebrations in Algeria and across the Arab world, not to mention the thousands of fans who packed out the El Merreikh stadium.
The BBC is not responsible for the content of external internet sites.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.