Dubai: Devendra Bishoo took 8-49 in the Pakistan second innings to give the West Indies an outside chance of securing a stunning victory in the first day/night Test in Dubai.
On an entertaining fourth day, Pakistan bowled the West Indies out for 357 to secure a first innings lead of 222 but decided against enforcing the follow-on.
However, leg-spinner Bishoo then produced a sensational display, taking all but two of the wickets to fall as Pakistan were skittled out for 123.
That left West Indies needing 346 to win and they closed on 95-2, setting up a potentially fascinating final day.
Shah has enjoyed huge success in his Test career so far and, when he bowled Miguel Cummins, he reached 100 wickets in the joint second-fastest time in history (17 Tests).
Pakistan decided to bat again with a huge lead but lost first innings triple-centurion Azhar Ali (two) and Asad Shafiq (five) cheaply to slip to 20-2.
Sami Aslam (44) and Babar Azam (21) added 57 for the third wicket but, with rough marks on the pitch helping spinners, Bishoo then triggered a middle-order collapse.
Having already trapped Shafiq leg-before, he dismissed Azam, Aslam, Misbah-ul-Haq (15), Mohammad Nawaz (0) and Wahab Riaz (five) in the space of 40 balls for just 21 runs.
He then needed five balls after tea to remove Sarfraz Ahmed stumped for 15 and then bowled Amir for one to record the fifth best bowling figures in an innings for West Indies in all Test cricket.
The final eight Pakistan wickets had fallen for 46 runs, leaving West Indies chasing 346 to win, and they were 27-1 when opener Kraig Brathwaite (six) was bowled by Mohammad Amir.
But Leon Johnson (47) and Darren Bravo (26 not out) then gave the chase some impetus with a second-wicket stand of 60.
However, Amir (2-26) removed Johnson lbw just before the close, leaving Marlon Samuels and Bravo to see the West Indies to stumps.
After a dramatic day in which 16 wickets fell, Pakistan remain favourites to take a 1-0 lead in the three-match series, while the West Indies will be hoping Bravo and Samuels can lay the platform for an unlikely victory.