The match came three days after Barcelona suffered a stunning 5-4 defeat at lowly Levante in their second last La Liga match, robbing them of a chance to complete the season unbeaten.
That feat was last achieved in 1932 by Real Madrid, the arch-rivals of Barca, when the season comprised 18 fixtures compared with 38 now.
Barcelona were ahead within three minutes as a Bangaly Soumahoro pass was intercepted by Dembele, who rifled the ball past Uganda goalkeeper Denis Onyango.
Not every day can you get your photo taken with Leo #Messi ? Gràcies ?? pic.twitter.com/noXLzKTzvH
— FC Barcelona ?? (@FCBarcelona) May 16, 2018
Ivorian Soumahoro was also at fault for the second goal, failing to cut off a Denis Suarez pass on 19 minutes and Luis Suarez made no mistake from close range.
Between the goals, Sundowns’ star attacker Percy Tau had two chances, but his chip was saved by Marc-Andre ter Stegen and he fired a close-range free-kick over.
Denis Suarez rattled the woodwork with a header as Barcelona constantly threatened and turned over two goals ahead.
Valverde made 10 changes during half-time, but Messi was not among those introduced, leading the crowd to repeatedly chant “Messi, Messi, Messi”.
More sloppy defending gave Barcelona a third goal on 67 minutes when an interception set up Gomes to fire past substitute goalkeeper Kennedy Mweene.
Although clearly second best, the 2016 African champions never lost heart and were rewarded when Vilakazi scored on 76 minutes as Barcelona appealed for offside.