South Africa, fifth in 1999 and 2005, amassed 10 medals including five golds over the five-day championships.
They started the final day with a 1-2 in the men's 200 metres, won by Retshidisitswe Mlenga in a season's best time of 21.03.
The 17-year-old Mlenga, who already held the best time at altitude of 21.14secs, held off compatriot Tshenolo Lemao in a reverse result to the men's 100m.
"I came in very focused, having made a mistake in the 100m finals that happens to be my favourite race," said Mlenga.
"I listened to my coach's instructions this time, and I am happy to have won the gold medal."
Lemao, who won South Africa's first ever gold in the 100m, took silver in a personal best 21.12 while Germany's Luis Brandner (21.23) was third.