West Indies, who were 18/6 at one point on day four, showed tremendous grit but could not avoid defeat as Sri Lanka wrapped up the innings in the second session of day five to take a 1-0 series lead.
Starting from an overnight score of 52/6, Joshua Da Silva and Nkrumah Bonner continued their resistance against the Sri Lankan spinners.
Both the batters were extremely cautious in their approach, not scoring a single boundary in the first 16 overs of play after which they decided to take the attack to the bowlers, scoring four boundaries in the next six overs. They soon brought up the team hundred, which yesterday looked like a distant possibility when they were at 18/6.
Though the bowlers did manage to create chances frequently, Da Silva and Bonner found ways to survive. Bonner was given a reprieve by Pathum Nissanka, who spilt a diving catch at covers.
Da Silva brought up his third Test half-century but as soon as they got to the 100-run partnership, Lasith Embuldeniya crucially struck for Sri Lanka a few overs before lunch. He got the ball to spin away from the right-hander, who edged it to the safe hands of Dhananjaya de Silva at slips.
Rahkeem Cornwall joined Bonner in the middle and the two took West Indies safely to lunch at 125/7.
After the break, Bonner continued to live dangerously, surviving a DRS appeal for an LBW and then was given another lifeline through a dropped catch, with skipper Dimuth Karunaratne the culprit this time.
Cornwall eventually became a victim of his instincts as he was lured into a big shot by a flighted delivery by Praveen Jayawickrama. Suranga Lakmal completed a good catch at long-on to take Sri Lanka within touching distance of a win.
Embuldeniya wrapped up the game with wickets in consecutive overs to complete his five-for. Bonner could only watch from the other end as he was left stranded on 68* off 220 balls.
The win by 187 runs gave Sri Lanka a 1-0 lead in the two-match Test series and takes them to the top of the ICC World Test Championship 2021-23 table.