A month ago, Pakistan was embarrassed. Their run chase against Zimbabwe in Harare fell short by 24 runs, giving Zimbabwe their first win over a major test team in 12 years, and their first win over Pakistan in 15 years.
Fast forward to today, and in their first test since the horror in Harare, Pakistan finished off blowing away top-ranked South Africa by seven wickets in less than four days.
An incredible win that looked likely late yesterday when South Africa, 193 behind on the first innings, stumbled to 72-4 at stumps, became inevitable when the Proteas could make only 232.
Pakistan made hard work of the mere 40 they needed for the victory, being 7-3 before captain and mainstay Misbah-ul-Haq steered them home with a straight six back over spinner Robin Peterson about an hour after tea.
"It's really unbelievable, this (victory) was much needed for us," Misbah said. "A win is always important for a team to boost its confidence and especially against the No. 1 team, it's something special."
This was only Pakistan's fourth win in 22 tests against the Proteas, the last six years ago. Suddenly, Pakistan can dream of only a second series win against them, the last 10 years ago in Pakistan.
The second and final test in Dubai starts on Wednesday.
South Africa could hardly believe what happened. In their last test in February, they wrapped up a 3-0 sweep of the Pakistanis at home. That extended their unbeaten run in tests to 15, including 10 wins, over the last two years.
"Extremely disappointed," captain Graeme Smith said. "We have set really high standards for ourselves ... but right from session one, they have been ahead in the game and played better cricket."
Pakistan put Smith's team under pressure from the outset after restricting the Proteas to 249, highlighted by Hashim Amla's 118. The last six wickets were lost for 50 runs.
Pakistan replied with 442. Man of the match Khurram Manzoor hit his maiden century worth 146, and featured in a century opening stand with Shan Masood, whose 75 followed a 50 against the Proteas in the warm-up match, which earned him his debut. Misbah added his first century in two years.
After Amla and the top order were dismissed cheaply late Wednesday, AB de Villiers resisted with a gritty 90 off 157 balls with seven fours and a six but gave a tame catch in the covers. The only other knock of note was Peterson's, who was 47 not out and ran out of partners.
Left-arm spinner Zulfiqar Babar, in his first test, clean bowled nightwatchman Dale Steyn off his third delivery of the day, and JP Duminy looked shaky in his brief stay as seamer Junaid Khan had him trapped leg before wicket for a duck.
Babar should have had the wicket of Faf du Plessis on 6 before lunch but wicketkeeper Kamran Akmal couldn't hold on to a thick edge.
De Villiers was the only batsman to read the spinners well as he raised his half century with a straight six over Babar's head, in the same Sheikh Zayed Stadium where he made his career best unbeaten 278 against Pakistan in 2010.
But Pakistan struck immediately through offspinner Saeed Ajmal after lunch when he made a reflex one-handed low catch off his own bowling to dismiss du Plessis for 9, then de Villiers departed after putting up an innings-best partnership of 57 with Peterson.
Peterson and Vernon Philander stretched the lead to 39 by adding 42 for the ninth wicket.
Ajmal took 4-74 while Khan claimed 3-57 as South Africa struggled to adjust to the slow and spinning pitch.
Pakistan then endured some batting jitters against pacemen Philander and Steyn before Misbah and Younis Khan secured victory from 7-3 with an unbeaten stand of 38.
"Conditions suit our batting and the record of our bowlers is very good here in the UAE, which was a major difference in both teams," Misbah said.