Port of Spain - Kusal Mendis led a strong Sri Lankan second innings effort but West Indies still held the advantage at stumps on day four of the first Test at the Queen's Park Oval in Trinidad on Saturday.
Set a daunting target of 453 when the hosts declared their second innings at 223 for seven just after lunch, the visitors reached 176 for three by the close with Mendis unbeaten on 94.
They require another 277 runs on the final day and will be hoping their captain Dinesh Chandimal, who retired unwell on 15 in the afternoon session, can resume his innings to bolster a team that looked completely out of contention at the start of the day's play.
Given that the world record for the highest successful run chase in the fourth innings of a Test match is 418 - set by the West Indies against Australia in Antigua in 2003 - the odds are very much stacked against the Sri Lankans, especially with the pitch offering more variable bounce that could prove increasingly hazardous on the final day.
However, if Mendis can replicate the determination he showed through nearly four hours at the crease and get the support from his teammates, starting with nightwatchman Lahiru Gamage, then a draw at the very least still remains a possibility.
His innings has not been without incident, though, as he would have been given out caught behind off fast bowler Shannon Gabriel when on six had West Indies captain Jason Holder opted for a television referral of the not out ruling given on the field.
Mendis, who has so far faced 186 deliveries and struck two sixes and nine fours, was also dropped on 42 by wicketkeeper Shane Dowrich off leg-spinner Devendra Bishoo.
It was Bishoo who claimed the final wicket of the day just before bad light ended play when he had Roshen Silva caught and bowled off a leading edge.
Gabriel had earlier despatched Mendis's opening partner Kusal Perera to a first slip catch by Devon Smith in the fourth over of the innings and after Chandimal left the field with his personal score on 15.
Former skipper Angelo Mathews added 74 runs with the resolute Mendis until he fell to a leg-side catch by Dowrich off Holder for 31.
Earlier, having pushed the lead beyond the 400-run mark in the morning session when they lost three wickets and added a further 78 runs, including Kieran Powell for a top score of 88, West Indies batted for an additional 15 minutes in the afternoon session before Holder declared.
It was the first time since the drawn 1985 fixture against New Zealand in Georgetown, Guyana that the West Indies had declared in both innings of a Test match.
Most of the attention in the morning session surrounded the prospect of Powell reaching a fourth Test century.
Impressing with his elegant stroke play in reaching 64 overnight, the left-hander looked well on course to reach three figures but an error of judgement brought an end to his innings as he failed to get to the pitch off an attempted leg-side flick off spinner Dilruwan Perera and substitute fielder Jeffrey Vandersay took a good catch diving forward at midwicket.
Fast-medium bowler Lahiru Kumara again led the Sri Lankan effort with figures of three for 40 to finish with seven wickets in the match.