The 2017 SEA Games have been plagued by an unusual number of noteworthy incidents that have taken place outside of the competition itself. Here is a summary of the five most significant:
1. Indonesia flag blunder
Games organisers Malaysia printed neighbour Indonesia's flag upside down in a commemorative magazine.
The blunder came to light during the Games' opening ceremony on Aug 19, compelling the organisers and Malaysia's foreign ministry to issue an apology.
Such was the extent of the anger from Indonesian netizens - who responded by mounting cyber attacks on more than 30 Malaysian websites - that the country's President Joko Widodo stepped in to smooth things over.
He said: "We deeply regret the incident but do not exaggerate it."
2. Flag blunder Part 2
The mix-up over national flags was subsequently extended to the rest of the region when Malaysia's national broadcaster RTM got eight of 11 flags wrong in a medal tally broadcast during news segments on Thursday and Friday.
Broadcasters then proceeded to get Malaysia's own flag wrong, tagging national swimmer Keith Lim with the Singapore flag during the men's 50m freestyle final on Friday, and also abbreviating Lim's country as "KUL" instead of the usual "MAS".
3.Sultan of Johor issues challenge to Malaysia's polo team
The Malaysian team were convincing victors in the polo final, beating Singapore 13-2, but the Sultan of Johor appeared less than impressed by the feat.
"If you're a man, play against the Johor team," wrote Sultan Ibrahim Iskandar, in a Facebook post on Aug 24. It is believed to have been directed at Malaysia's Youth and Sports Minister Khairy Jamaluddin, who featured in the gold-medal winning side.
"I challenge the SEA Games polo team to come to Johor and show your fangs since news of your greatness supersedes you."
Khairy was granted an audience with the Sultan a day later, but it was not clear what transpired during the meeting, reported several Malaysian news outlets.
4. Malaysian athletes hit by food poisoning
Food poisoning became the latest piece of bad news that the Malaysia Organising Committee (Masoc) had to deal with when 16 athletes came down with a stomach bug last Wednesday at the Renaissance Kuala Lumpur Hotel, where the bulk of Malaysia's 844-strong contingent are based.
The number of affected athletes rose to 30, following an update from SEA Games Federation president Tunku Imran Tuanku Ja'afar on Monday.
The affected athletes come from a variety of sports, including swimming and petanque.
5. Unruly behaviour from Malaysian football fans
Malaysia's football fans also made the headlines for the wrong reasons, after they were recorded chanting "Singapore dogs" during the two countries' match on Aug 16, won by Malaysia 2-1.
The home supporters came under further scrutiny when it was revealed that two Myanmar fans had been beaten up during the Malaysia-Myanmar game last Monday.
Police said the Myanmar fans were punched and kicked in the face and body outside Shah Alam Stadium. One was admitted to hospital while the other left after treatment.