Pakistan turned the tables on Sri Lanka in the first Test after Asad Shafiq hit a century to lead a remarkable rearguard action by the lower order on the fourth day on Saturday. The tourists, who resumed the day at 118-5 in reply to Sri Lanka's 300, piled up 417 in their first innings before being dismissed in the post-tea session with a lead of 117 runs in Galle.