Tanvir who is already in South Africa playing for Highveld Lions was called up as a reinforcement after Umar Gul and Muhammad Irfan are found struggling with fitness.
Irfan was played in the third one-day international on Sunday but he limped off the field after bowling seven overs due to a hamstring injury he picked up in the second ODI in which he captured four wickets.
Team sources said that Gul is also struggling with illness and a knee problem.
Tanvir was initially not selected in the Pakistan squads announced for the T20 and ODI series. He was seen sitting with the Pakistani players in the dressing room on Sunday.
The Pakistan management had earlier before the start of the Test series also called up Tanvir Ahmed and Rahat Ali as reinforcements.