Messi gave Argentina, one of the favourites to win the tournament, a 10th-minute lead from the penalty spot with a coolly taken spot kick.
But two goals early in the second-half, including an outstanding strike from Salem Al-Dawsari, turned the game on its head and left the Albiceleste with little margin for error against Mexico and Poland in their other Group C fixtures.
Argentina came into the game overwhelmingly expected to win and were on course to match Italy’s record 37-match unbeaten run when they went ahead early on thanks to Messi’s penalty, which came about following a VAR check for pushing and shoving in the box.
Messi, playing in his fifth World Cup, beat Saudi Arabia goalkeeper Mohammed Al-Owais on a breakaway but that goal and two others by Lautaro Martinez were ruled offside as Saudi Arabia’s high defensive line held firm.
Saleh Al-Shehri squeezed in a low shot in the 48th minute while Al-Dawsari curled in a scorching strike from the edge of the penalty area in the 53rd minute to leave Argentina looking on in disbelief.
Despite plenty of possession after that, Argentina were unable to break down Saudi Arabia, who were competing in their sixth World Cup but had never previously won an opening game.
Al-Owais saved well at point-blank range to deny Argentina when Lisandro Martinez’s shot deflected off Nicolas Tagliafico but Lionel Scaloni’s side, who have four players older than 34 in their starting XI, looked tired in the final 30 minutes.
Saudi Arabia fans, meanwhile, chanted “Where is Messi? We beat him!” as they celebrated their shock lead.
As Saudi Arabia, who at 51st are the second-lowest ranked team in the tournament, closed in on a famous victory, the game was delayed after a nasty collision between Al-Owais and Yasir Al Shahrani that resulted in the defender leaving the pitch on a stretcher.