The 34-year old finished with a career best 5-32 while fit-again paceman Dale Steyn took 3-38 to bundle Pakistan out for 99 all out in 36.4 overs at the Dubai stadium before South Africa finished the day on 128-3. They lead by 29 runs and enjoyed a good day in their bid to level the two-Test series after losing the first game by seven wickets in Abu Dhabi last week.
Graeme Smith was unbeaten on 67 and nightwatchman Steyn was three not out. Smith, who looked rusty in Abu Dhabi, hit spinner Saeed Ajmal for two consecutive boundaries to bring up his half-century as well as taking his team past Pakistan's total.
In the morning session Pakistan's top-order batsmen were so dismal that number nine Zulfiqar Babar top-scored with 25 not out and opener Shan Masood made 21. Of the six boundaries in the innings, Babar hit three and Masood one. This is the 16th time that Pakistan were bowled out for below 100 in a Test innings.
It brought back memories of Pakistan's same total against then world number one England at the same venue in 2012, although they went on to win the Test in the end. But a ruthless South Africa, now the world number one Test side, looked in no mood to concede the early advantage as they now look set for a big first innings lead.
Smith and Dean Elgar, replacing Hashim Amla -- who failed to come back after returning home for the birth of his child -- added 54 before Ajmal had Elgar for 23. Pakistan also removed opener Alviro Petersen for 26 and Jacques Kallis (seven) on a day when Tahir gave Pakistan a dose of their own spin medicine.
Tahir, playing his first Test since November 2011, dismissed opener Shan Masood (21), Misbah-ul Haq (two) and Akmal (nought) off just 11 deliveries to leave Pakistan in tatters at 60-6 by lunch. Tahir commented: "It's not that I wanted to show something, I just wanted to do well for the world's best Test team."
Born and brought up in Pakistan, Tahir qualified to play for South Africa in 2011 after marrying a local girl but has since taken time to establish himself in a country not known for spinners. Pakistan coach Dav Whatmore showed anger over his team's slump.
"Its frustrating," said Whatmore. "Certainly not according to the plans, we knew they will come back hard but we orchestrated our own downfall with poor shot selection." Steyn, cleared from a hamstring injury suffered on Sunday, gave no signs of discomfort as he dismissed opener Khurram Manzoor off the second delivery of the match and then had Younis Khan (10), on a pitch which looked good for batting.
Manzoor, who hit a career best 146 in the first Test, failed to score. Azhar Ali then put on 38 for the second wicket with Masood before he was trapped leg-before by paceman Morne Morkel for 19. Masood remained steady until he played an over-ambitious drive off Tahir and was bowled off an inside edge.
Steyn returned for his second spell to have Younis, caught behind off a rash shot with the score at 60 before Tahir got two more on the same score. Misbah, Pakistan's most successful batsman this year, misread a googly from Tahir while Akmal went back to play a sharp delivery and was bowled.
After lunch Tahir -- who replaced Robin Peterson from the first Test line up -- bowled Shafiq for ten and then dislodged Mohammad Irfan to imrpove on his previous best of 3-55, came against Australia at Johannesburg in 2011. Pakistan's total was boosted by a 33-run last wicket stand between Babar and Junaid Khan. Khan was finally bowled for four by Steyn.