Kraigg Brathwaite became the fifth West Indian batsman to carry his bat with an unbeaten hundred before Jason Holder took 3-10 to leave Pakistan under pressure in the third Test in Sharjah on Tuesday.
Brathwaite held West Indies's first innings of 337 with a resolute 142 not out before Holder jolted Pakistan with three wickets in 17 balls to give his team a strong position at the end of the third day.
At close Pakistan were struggling at 87-4 with opener Azhar Ali 45 not out and Sarfraz Ahmed 19 not out, leading only by 31 runs with six wickets intact and two days to play.
Pakistan needed a big effort after conceding a 56-run lead but from 37-0 they lost four wickets in the space of 11 runs with Holder firing on all cylinders and their batsmen playing rash shots.
Holder forced Sami Aslam (17) to hook straight into the hands of deep fine-leg, then in his next over had Asad Shafiq caught in slip fending a short ball for nought, his second in the match.
An over later Holder had Younis Khan caught behind for zero and from the other end Misbah-ul-Haq holed out off spinner Roston Chase for four.
West Indian paceman Shannon Gabriel had Ahmed caught in the slip for nine only to see the umpire calling a no-ball, allowing the stand to reach 39 by close.
If West Indies pull off a win it will be their first in 13 Tests since beating England at home in May last year while Pakistan will spoil a good chance of a 3-0 whitewash after winning the first two Tests in Dubai (56 runs) and Abu Dhabi (133 runs).
The highlight of the morning session was Brathwaite's knock. He held the innings with eleven boundaries and for the first time in the series lifted West Indies into a rare lead.
Brathwaite added an invaluable 60 runs for the eighth wicket with Devendra Bishoo who made a solid 27 to leave Pakistan spin-cum pace attack frustrated.
In the end it was left to the lively pace of Wahab Riaz to take the final three wickets for his second five-wicket haul in Tests, finishing with 5-88 in 26.4 overs of hard work.
Riaz, whose first five-wicket haul came in his debut Test against England at The Oval in 2010, had Bishoo caught behind before dismissing Alzarri Joseph (six) and Shannon Gabriel (nought) to warp up the innings.
Pace partner Mohammad Amir took 3-71 while the spinners Yasir Shah and Zulfiqar Babar took a wicket apiece.
It was Brathwaite who defied the bowling, emulating illustrious West Indians Frank Worrell, Conrad Hunte, Desmond Haynes (thrice) and Chris Gayle in remaining not out throughout a Test innings.
Brathwaite had a lucky escape when wicketkeeper Ahmed failed to hold a sharp, rising edge off spinner Mohammad Nawaz when he was on 121.
In the same over, Bishoo was given out off a sweep shot but he successfully reviewed English umpire Michael Gough's decision as the ball had hit fielder Ali's helmet before he took the catch.
Resuming at 244-6, the West Indies were looking for a good lead.
Brathwaite hit Amir for his 11th boundary off the day's first ball, and then on-drove him towards mid-wicket for two to reach his hundred off 211 balls.
Pakistan took the second new ball with the total on 251 and Amir struck instantly, clean-bowling Holder with a sharp incoming delivery for 16.