Egypt's hordes of supporters showed their support for Salah, roaring him on whenever he got near the ball.
And the 26-year-old has apologised for that, before insisting the team would be back for the 2022 competition in Qatar.
Saudi Arabia face Egypt on Monday afternoon with both sides already out of the World Cup and now purely playing for pride.
Subs: Aseri (6), Al Shehriat (6).
The first match was a 1-0 defeat to Uruguay, whereas the second was a 3-1 loss to Russian Federation.
Egypt goalkeeper Essam El Hadary, who is 45, took the field for his team's final group match to set the record.
Al Muwallad took the spot-kick, but his firm strike was brilliantly pushed onto the bar by the veteran.
However, right before the end of the first half and after intense referee deliberation, S. Al-Faraj scored in a penalty shot before another and final shot was secured by S. Al-Dawsari in the last seconds of extra time.
Saudi Arabia fielded Yasser Al-Mosailem as the goalkeeper, meaning that the kingdom's three keepers will each have played one game in Russian Federation.More news: FIFA WC: Osako's header snatches 2-1 win for Japan
More news: Neymar returns to practice, Brazil guarantees he is ready
More news: US, Turkey Begin 'Coordinated, Independent' Patrols Near Manbij
The Liverpool forward, mistakenly omitted from the starting XI in the initial tweet from the Egyptian FA, collected a long ball from Abdallah El Said and finished with a lofted effort over the head of keeper Al-Mosailem.
It was an incredible moment from El Hadary and one of the best feel-good moments of the tournament so far.
The game looked to be heading for a draw until Salem Al Dawsari's victor deep into stoppage time handed Saudi Arabia all three points.
Not bad for the oldest player in World Cup history...
El-Hadary is two years and 158 days older than Colombian Faryd Mondragón, who previously held the record.
Mohamed Salah became the first African player to score in his first two appearances at the World Cup, scoring against Russian Federation on MD2 and Saudi Arabia today.
Hadary saved a first half penalty from Fahad Almuwallad and produced several excellent stops in the second half but could do nothing to prevent Alburayk's late finish.
Saudi Arabia tried to test Al Hadary early, with Hussain Al Mogahwi attempting a speculative chance from distance in the third minute, but it hooked well wide of the goal.
Saudi Arabia midfielder Abdullah Otayf completed 110 passes in this match, the most by an Asian player in a World Cup match since 1966.