It was followed by Indonesia with 22 gold medals and Thailand with 18 golds.
The games saw nine records broken, all in swimming and achieved by Vietnamese students.
The closing ceremony treated the audiences and athletes to colourful artistic performances, with 10 sport delegations participating in a parade to honour their achievements.
Vietnamese Deputy Minister of Education and Training and head of the organising committee Nguyen Thi Kim Chi handed over a symbolic flag to a representative from Brunei – the host of 14th edition.
In her remarks, Chi said the ASG, featuring six sports with 107 competition events, provided an opportunity to form and create new friendships. Through sports, differences and boundaries are overcome to unite in building a strong and cohesive ASEAN community.