Sri Lanka need just four wickets to win the first Test against West Indies in Galle after setting the all-but-impossible target of 348 on Wednesday's penultimate day of play.
West Indies had made just 52 before bad light forced an early end after the hosts' spin trio made quick work of the top order.
The sensational collapse saw the tourists lose four wickets in 15 balls for just four runs.
Ramesh Mendis was the pick of the bowlers finishing with four for 17. The off-spinner had the makings of a hat-trick as he trapped Kyle Mayers leg before, reports AFP.
Jason Holder was expecting the ball to turn into him on the next delivery but a straight path smashed his off-stump.
Joshua da Silva walked in to face the hat-trick ball but it was wayward from Mendis, who bowled down the leg-side.
Lasith Embuldeniya accounted for Jermaine Blackwood and Roston Chase.
There was little hope for West Indies at 18 for six and all signs were that the game was going to end on the fourth day.
Then Nkrumah Bonner (18) and da Silva (15) batted for just over 45 minutes to hang in before the umpires called bad light.
ASH