In the first ball of the 19th over, Pandey got a single off Dane Paterson but Dhoni thought there was another run to be had. He called for a second but Pandey was not paying heed to the former captain's call.
And then Dhoni lashed out angrily at Pandey for watching the ball instead of looking at his partner.
A video of Dhoni admonishing Pandey went viral soon after.
Dhoni went on to hit a six and two fours off the next three deliveries and brought up only his second fifty in T20 Internationals.
At the end, thanks to Pandey and Dhoni's efforts, India posted 188/4 on a day Shikhar Dhawan, Rohit Sharma and Virat Kohli scored only 25 runs between them. The wet conditions made bowling tricky for India and South Africa completed a comfortable victory to draw level in the three-match series.
Most fans were shocked to see Dhoni react so angrily. He is known for his calmness and cool under pressure. Even as captain, Dhoni rarely betrayed his emotions. Then what was going on now?
The stump microphone has often picked up Dhoni guiding Indian bowlers and fielders during the course of play. He is often witty, he rebukes, he motivates but never does he show any kind of anger.
But on Wednesday, Dhoni really did lose it with Pandey.
Here's the bigger picture though: Dhoni wanted to run the second run for Pandey. He wanted to ensure India did not miss the opportunity to add a single run to their score - India were after all trying to close the series in Centurion and every run was crucial.
Dhoni stepped down as India's limited-overs captain in January 2017 but he continues to strategise on the field.
VIDEO