Colombo - Part-time spinner Kraigg Brathwaite took six wickets in an inspired bowling performance as West Indies bowled Sri Lanka out for 206 in their second innings, setting themselves a victory target of 244 in the second test.
The 22-year-old, who had taken just one wicket in his previous 23 tests, finished with figures of 6-29 and gave West Indies a great chance of tying the two-test series.
The hosts, who won the opening test in Galle by an innings and six runs, were all out an hour after the lunch break with Brathwaite taking the last six wickets to fall in Sri Lanka's second innings with his off-spin.
Resuming on 76-2, Sri Lanka were pegged back early when they lost two wickets in three deliveries, with both overnight batsmen getting out.
Opener Kaushal Silva (32) was the first to fall when he edged debutant spinner Jomel Warrican to slip, and two balls later paceman Jerome Taylor forced a nick from Dinesh Chandimal (12) for wicketkeeper Denesh Ramdin to complete a smart catch.
Captain Angelo Mathews (46) and Milinda Siriwardana (42), Sri Lanka's top-scorer from the first innings, added 67 for the fifth wicket to steady the innings and took the team's lead closer to the 200-run mark.
With Marlon Samuels' bowling action under a cloud after he was reported for the third time in his career, West Indies captain Jason Holder called on Brathwaite to break the stand.
The bowler responded brilliantly, sending back Siriwardana in his second over before enjoying more success with the first delivery of his next over when Kusal Perera (five) got an under edge for Ramdin to hold on to another good catch.
Rangana Herath made a useful contribution of 18, using both the conventional and reverse sweep against the spinners, before he became Brathwaite's third victim.
Brathwaite also claimed the wicket of Dilruwan Perera, then dismissed Mathews and number 11 batsman Nuwan Pradeep in successive deliveries to close out Sri Lanka's innings.