West Indies require 297 with nine wickets remaining to claim a series-clinching Test victory over Pakistan following a dramatic penultimate day in which 14 wickets fell in Dominica.
Chasing 304, the Windies went to stumps at 1-7 from 6.3 overs after Kieran Powell was caught at silly point off leg-spinner Yasir Shah to what proved to be the final ball of the day.
Pakistan had seized control of the Test during the morning session, Mohammad Abbas taking four of five wickets to fall for just 29 runs to return figures of 5-46, helping dismiss the Windies for 247.
However, the tourists struggled to build on their first-innings lead of 129 as they slipped to 7-90, with retiring veterans Younis Khan and Misbah-ul-Haq both failing to make significant scores in their final Test knocks.
Younis, who earlier took a Pakistan-record 10th catch in the series, and Misbah fell in quick succession to Devendra Bishoo, for 35 and two respectively, and left the field to a guard of honour from their teammates.
But Mohammad Amir and Yasir, who hit a career-best 38 not out, frustrated the hosts with a 61-run eighth-wicket stand to allow Pakistan to declare on 8-174, heaping the pressure on the Windies on the final day.