The right-handed batsman scored 64 off just 29 balls after Proteas captain Faf du Plessis won the toss and opted to bat first in the Super 10 Group One match.
De Villiers smashed five sixes and four fours as South Africa got their bid for a first international trophy back on track after an opening day loss to England.
World T20: Root inspires England to two-wicket win over South Africa
Afghanistan made a flying start to their run chase, racing to 50 in 3.4 overs, but the gulf in class was evident as they eventually fell short on 172 all out on the last ball.
Chris Morris was the star of the South African bowling, taking four for 27.
South African left-hander Quinton de Kock made 45 off 31 balls, including six fours and two sixes, before being caught by wicket-keeper Mohammad Shahzad off Amir Hamza in the 12th over at the Wankhede Stadium.
Kohli gifts Amir bat in fresh show of love
Du Plessis made a tidy 41, which included seven fours and one six, before being run out in messy fashion in the tenth over.
Opener Hashim Amla had earlier walked for a disappointing five after he hit a weak shot in the third over straight to the safe hands of Afghanistan skipper Asghar Stanikzai.
South Africa sat on 92/2 at the half-way stage of their innings before de Villiers came in and upped their run-rate, hitting Rashid Khan for an astonishing four sixes in the 17th over.
He was caught by Noor Ali Zadran off Mohammad Nabi near the boundary in the 18th though as he attempted yet another six.
David Miller made 19 while JP Duminy was not out on 29 as South Africa set the Afghans a formidable run-chase of 210.
Destructive opener and Afghan talisman Shahzad did his best to frighten South Africa's bowlers in the early stages, hitting three sixes and a four off Kyle Abbott over.
But any hopes the Afghans had of causing a sensational upset were effectively over when Shahzad was bowled by Morris for 44 with the last ball of the fourth over.
Morris grabbed his second wicket shortly afterwards when Afghan captain Stanikzai was caught behind by wicketkeeper de Kock for seven runs.
The right-arm paceman was the star of South Africa's bowling attack, grabbing four wickets for 27 runs.
Imran Tahir, Kyle Abbott and Kagiso Rabada all claimed two each.
The only sour note for South Africa was the withdrawal from the field of Duminy because of a hamstring injury.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ