Kraigg Brathwaite hit an unbeaten 142 and red-hot Jason Holder then took 3-10 as a resurgent West Indies put Pakistan under pressure in the third Test in Sharjah on Tuesday.
Brathwaite held together West Indies' first innings of 337 with a resolute 142 not out before Holder jolted Pakistan with three wickets in 17 balls to propel the tourists into 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 the Pakistan batsmen playing rash shots.
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).
Holder said it was Brathwaite who had fired the West Indies.
"He played an excellent innings," said Holder. "He showed a lot of character and gave us the belief in our fight and it was very inspirational for me and gave me the energy to go all out."
Holder was on fire too. He 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 call a no-ball, allowing the stand to reach 39 by close.
The highlight of the morning session was Brathwaite's knock.
He inspired the innings with 11 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's 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 Gabriel (nought) to wrap 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 (three times) and Chris Gayle in remaining not out throughout a Test innings.
He 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 but he successfully reviewed English umpire Michael Gough's decision.
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.
International cricket is more affordable than ever this summer, with adult tickets from $30, kids from $10 and family packages from $65 across every day of international cricket. Price for purchase at match. Transaction fee from $6.95 applies to online and other purchases. For more information and to purchase tickets, click here.