The turnaround in this Test has been nothing short of remarkable. Sri Lanka were staring into the jaws of defeat after crumpling to 32 for 5 on a damp Monday morning. But by Tuesday evening Sri Lanka had not just swum into safer waters, they'd turned from prey to predator and are poised for the kill in the final two days.
Tom Moody had been left disappointed by Sri Lanka's lame top-order performance on the opening day, but he still insisted that Sri Lanka could drag themselves back into the match. However, the speed with which Sri Lanka completed their Houdini-like escape would surely have exceeded his wildest dreams.
The key to it all was the morning session and fine seam bowling from Farveez Maharoof - a young cricketer that graduated in this game from a youngster with a potential to an international player of confirmed class. With play starting 30 minutes early again to catch-up lost time, Sri Lanka knew they needed to exploit possible morning moisture and they choose Maharoof to lead the attack with Muttiah Muralitharan.
The selection of Mahroof turned out to be a shrewd move as he was the bowler most likely to land the ball in the right areas. Moreover, since remodelling his bowling action, becoming less side on and ensuring his front arm is straight, he has added extra nip and potency. His action now looks far more stable and he bowled a brilliant first spell, taking 2 for 23 from seven probing overs.
Inzamam's scalp was, undoubtedly, the turning point of the day. After he'd nibbled at a leg cutter he might have left alone in the second over, Sri Lanka knew they were right back in the game. The delivery to dismiss Abdul Razzaq was even better, jack-knifing back from outside off stump. Maharoof's brace of wickets had opened up the lower order and Murali went to work with his customary efficiency, ensuring a slim lead.
Maharoof's starring role was followed by Upul Tharanga who stole the spotlight in the afternoon with a fine 72. It is true that there are chinks in his technique outside his off stump and he needs to tighten up defensively, but it is also becoming increasingly clear that Tharanga has spirit and mental resilience. Here, under pressure, he gave Sri Lanka the perfect start in testing conditions.
Tharanga's shot selection was immaculate as he pounced on any opportunity to score and his placement was impressively precise. He sheltered an out-of-sorts-looking Sanath Jayasuriya, who contributed just 13 to an opening stand of 53, and then provided the perfect foil for Kumar Sangakkara who was determined to bed down for a long stay and happy to slip into the sheet-anchor role.
Sangakkara has been at the receiving end of a few lbw decisions, a couple of which have been shockers, and in the first innings he was castled by a peach of a delivery. But today he was ruthlessly disciplined, cutting out risks during a tough afternoon's Test cricket. Sri Lanka might have drifted towards the close but after tea, following the fall of Tharanga, Mahela Jayawardene went for the jugular and raised the tempo of the innings, taking the match away from Pakistan with 69 in 103 balls.
Pakistan are still not out of the match but they must strike early. As soon as Sri Lanka's lead stretches past 300 then they are in trouble. While the pitch has eased, the spinners - Danish Kaneria bowled beautifully without reward - can expect plenty of turn during the final two days and survival will be extremely tough if Sri Lanka bowl well.
Charlie Austin is Cricinfo's Sri Lankan correspondent