A controversial second-half penalty ended Thailand's fantastic run in the AFC U23 Championship and shattered their dream of a place in the 2020 Olympics as Saudi Arabia chalked out a 1-0 win over the hosts on Saturday night for a place in semi-finals.
Abdullah Al Hamdan converted the penalty following a VAR review in the 78th minute at Thammasat Stadium in Rangsit to steer Saudi Arabia closer to a place in the Tokyo Games.
The top three sides in the AFC tournament earn tickets to this year's Olympic Games.
Al Hamdan struck decisively from the spot after he had been pulled back on his way into the area, with referee Ahmed Al Kaf awarding the penalty after confirmation of the offence by VAR officials.
Replays showed the incident took place outside the penalty area.
The goal was a cruel blow for Akira Nishino's team, who had matched the Saudis throughout the preceding 77 minutes in front of a sell-out crowd as both teams battled to keep their hopes of both the title and a trip to the Olympics alive.
Thailand coach Nishino made six changes to the team that started in a 1-1 draw with Iraq on Tuesday which ensured the War Elephants' place in the quarter-finals for the first time in the history of the tournament.
Supachai Chaided and Supachok Sarachat returned to the starting line-up and the Thais matched the wits of the Saudis in almost every department of the game.
Supachai and Supachok had opportunities to put the Thais ahead but both were off target and Al Hamdan returned the favour by missing one for Saudi Arabia in the ninth minute.
With a cheering crowd behind them, the Thais were in the ascendancy during the opening quarter but, as time wore on, Saudi Arabia established a foothold and dominated the game.
Thitawee Auksornsri had to be at his sharpest to snuff out the threat of Al Hamdan in the 17th minute while Khalid Al Ghannam's shot on the run called Thai goalkeeper Korraphat Nareechan into action.
With 12 minutes left in the first half Al Hamdan squandered his side's best chance of the first 45 minutes, sending the ball high over the bar after Sami Al Naji's cross from the right had evaded the Thai defence.
The second half saw Thailand put on a better show but it was largely a scrappy affair after the break.
Only Sorawit Panthong's speculative attempt from long range was worthy of note, until the Thai midfielder pulled back Al Hamdan to concede a penalty, dealing the home team a blow from which they never recovered.
Al Shabab forward Al Hamdan made no mistake from 18 yards, powering his penalty home via the underside of the bar to leave Korraphat with no chance.
With Thailand needing a goal to take the game into extra time, Nishino's side were always open to the counter-attack.
In the end, Al Hamdan's penalty was enough to take the Saudis through and keep their hopes of a first Olympic appearance since 1996 intact.