Egypt beat Australia 4-2 on penalties after a 1-1 draw in their FIFA World Cup Round of 32 match in Texas on Friday, reaching the last 16 of the tournament for the first time.
Hossam Abdelmaguid scored the winning penalty for Egypt after the match ended 1-1 following 120 minutes at the air-conditioned home of the Dallas Cowboys.
Mohamed Salah also scored in the shootout with a cool penalty as Egypt held their nerve to make history, leaving the captain in tears of joy.
Egypt will face Argentina in the last 16 if the reigning champions avoid a major upset against tournament debutants Cape Verde in their own last-32 match.
The Pharaohs will celebrate regardless, having reached this stage of a World Cup for the first time.
Egypt took the lead in the 13th minute through Emam Ashour, who headed in at the back post after a cross from Karim Hafez.
The goal came slightly against the run of play after Australia had nearly gone ahead inside the opening five minutes, when Cristian Volpato rattled the top of the crossbar.
Australia, who had scored only twice in the group phase, were forced to attack after Egypt's early breakthrough in front of a crowd of 70,000.
The Socceroos had their first shot on target 10 minutes before the break, when full-back Aziz Behich fired tamely at Egypt goalkeeper Mostafa Shoubir.
Shoubir's father, Ahmed, played in goal for Egypt at the 1990 World Cup.
Salah, who came into the match after a hamstring strain, made little impact in an attritional first half.
The half ended with Jordan Bos, one of the fastest players at the tournament, down after a robust flying challenge from Rami Rabia.
The wing-back had to be helped from the pitch and was replaced at halftime by Kai Trewin.
Seconds after the restart, Egypt missed a major chance to double their lead when Manchester City attacker Omar Marmoush slid the ball off target from close range.
Australia equalized 10 minutes after halftime when Mohamed Hany headed into his own net under pressure from an in-swinging Socceroos free kick.
It was Hany's second own goal of the tournament.
Egypt coach Hossam Hassan had said he was wary of Australia's physical approach, and the match remained tense as both sides sensed the chance to win a men's World Cup knockout game for the first time.
Salah remained on the fringes for much of the match but was involved in the buildup when Australia goalkeeper Patrick Beach made an athletic save deep in added time to deny Rami Rabia and force extra time.
Egypt finished normal time stronger, while Salah fired well over early in extra time on his weaker right foot.
With nothing to divide the teams after 120 minutes, the match went to penalties.
Australia coach Tony Popovic made a last-gasp gamble before the shootout, bringing on experienced goalkeeper Mathew Ryan for the penalties.
The shootout was taken toward Egypt's fans, with whistles raining down on Australia's penalty takers.
Defender Harry Souttar blazed Australia's first penalty over the bar, immediately putting the Socceroos under pressure.
The next five players all scored, including Salah, before 18-year-old Australia defender Lucas Herrington hit the bar.
Abdelmaguid then kept his nerve to score the winning penalty and send Egypt into the last 16.
The result ended Australia's hopes of a first World Cup knockout-stage win and gave Egypt their first victory in a World Cup knockout match.