Sri Lanka beat West Indies by 23 runs in the Cricket World Cup as Nicholas Pooran's counter-attacking knock of 118 went in vain for the Caribbean side.
Chasing 339 to win, West Indies lost Sunil Ambris and Shai Hope to Sri Lanka pace spearhead Lasith Malinga's fierce spell with the new ball.
Chris Gayle and Shimron Hetmyer added 49 but wickets fell at regular intervals to leave the Windies on the brink of another defeat at 145-5.
After failing to build on solid starts for the majority of the tournament, Pooran went on to make his maiden ODI hundred.
The 23-year-old left-hander combined with tailender Fabian Allen in an 83-run stand before Allen was run out for 51.
Pooran continued to find boundaries to set up a tense finale before he was caught behind off experienced all-rounder Angelo Mathews, who was bowling in an ODI for the first time since December 2017.
"Angelo put his hands up and said 'OK I will bowl two overs'. He has that confidence. He did the job," captain Dimuth Karunaratne said.
Malinga returned to trap Oshane Thomas lbw for his third wicket as West Indies finished on 315-9.
Earlier, West Indies struggled to make an impact with the new ball after winning the toss and the Sri Lankan top order batted well to post a mammoth 338-6.
Avishka Fernando smashed his first ODI century and opener Kusal Perera hit eight boundaries in his 51-ball 64 as Sri Lanka finished with their highest total of the tournament.
Fernando, playing his ninth one-dayer at the age of 21, finished with 104 off 103 balls including nine fours and two sixes, before he holed out to Sheldon Cottrell.
"When I went in I was very happy that I did what was required. I'm very happy to get a hundred in a win," man-of-the-match Fernando said.
"I am very happy to get this opportunity. All I focus on is taking this forward and developing my game."
Both Sri Lanka and West Indies were out of contention for semi-final spots.
Although Sri Lanka could beat India in their final group match to potentially join England on 10 points, they would miss out on qualification having won four games to England's five.
However, captain Karunaratne said he was pleased with the confidence levels in the Lankan dressing room as they look to finish the tournament on a high.
"To win any match is a great feeling. It gives us lots of confidence," he added.