Extra-time goals from Irfan Jauhari, Fajar Rahman and Beckman Putra earned Indonesia the SEA Games gold medal for the first time since 1991 with a 5-2 win over a Thailand side that finished the game with nine men in Phnom Penh on Tuesday.
Jauhari struck a minute into the first additional period after Yotsakorn Burapha had netted in the dying seconds of normal time to take the game into extra time with Rahman and Putra adding the gloss on a dramatic victory.
Ramadhan Sananta's first-half double had looked set to earn Indonesia the gold medal, the 20-year-old opening the scoring in the 21st minute when he steered a long throw by Alfeandra Dewangga beyond Thai goalkeeper Soponwit Rakyart.
The 20-year-old doubled the lead in first half stoppage time in spectacular fashion, lobbing home from 25 yards with Soponwit stranded on the edge of his penalty area.
Thailand, looking to claim the title for a record-extending 17th time, halved the deficit when Anan Yodsangwal headed in a 65th minute corner and then dramatically pulled level deep into stoppage time through Yotsakorn.
However, Jauhari put Indonesia back in front when he deftly lifted the ball over Soponwit before a bench-clearing brawl on the touchline raised tensions further.
Soponwit and Indonesia's Komang Teguh were sent off for their involvement in the altercation while the Thais were reduced to nine men in the 101st minute when defender Jonathan Khemdee received a second yellow card.
Rahman hit his side's fourth two minutes into the second period of extra time and Putra put the result beyond all doubt in the final minute to earn Indonesia gold for the fourth time.