West Indies face a daunting task at 34 for one heading into Thursday's final day.
Pathum Nissanka's hundred on debut and Niroshan Dickwella's pugnacious 96 solidified Sri Lanka's outstanding second innings rearguard with a total of 476 that left the West Indies with the challenging victory target of 375 on the fourth day of the first Test on Wednesday.
Notwithstanding their remarkable successful chase of 395 on the last day of the first Test against Bangladesh in Chattogram six weeks earlier, the hosts face a daunting task at 34 for one overnight heading into Thursday's final day.
West Indies captain Kraigg Brathwaite will resume in partnership with Nkrumah Bonner after Vishwa Fernando prised out John Campbell via a catch to a rueful wicketkeeper Dickwella.
Nissanka, who lost overnight partner Dhananjaya de Silva in the first over of the morning, slowed to a crawl in the second session of the day but finally reached the coveted century landmark just before tea to join Brendon Kuruppu (who completed a double-century), Romesh Kaluwitharana and Thilan Samaraweera as the only Sri Lankans to score hundreds on Test debut.
Samaraweera was the last to achieve the landmark before Wednesday, getting to three figures in his first Test, against India in Colombo in 2001.
"I wasn't even aware of any records or anything like that. I just wanted to perform for the team," said the 22-year-old Nissanka speaking through an interpreter.
"Niroshan kept telling me for us to prolong the innings for as long as possible and get a big total to make sure the bowlers had enough runs to work with."
Nissanka and Dickwella dominated the first two sessions of the day, putting on 179 for the sixth wicket and frustrating a West Indies team that was fast running out of ideas and doing little to help their own cause.
Bonner dropped the simplest of catches at gully off fast-medium bowler Jason Holder when Dickwella was on 45.
He also enjoyed a slice of luck closing on the elusive century when a half-hearted appeal by Alzarri Joseph for a catch to the wicketkeeper down the leg-side was turned down by the presiding umpire.
Replays revealed that the batsman edged the ball but the West Indies had no course for review having exhausted their television referrals earlier in the day.
If it appeared then that Dickwella was destined for a maiden Test hundred in his 42nd match, his growing anticipation of the moment came to nothing as he was bowled by Kemar Roach playing a lazy shot at the start of the final session.
He had been struck on the back of the helmet in the fast bowler's previous over when the ball rolled onto the stumps but did not dislodge the bails.
Nissanka had already departed for 103, compiled in 341 minutes off 252 balls and including six fours, and the innings quickly subsided in the rush for quick runs.
Roach and off-spinner Rahkeem Cornwall claimed three wickets each.
West Indian spirits had been lifted at the start of the day when de Silva, on reaching an even 50, was comprehensively bowled by Joseph operating with the second new ball.
However the rest of the day belonged to the Sri Lankans who will believe they can end a run of four consecutive Test match defeats on the final day.
Find latest and upcoming tech gadgets online on Tech2 Gadgets. Get technology news, gadgets reviews & ratings. Popular gadgets including laptop, tablet and mobile specifications, features, prices, comparison.
Dream 11 Team Prediction Sri Lanka vs Australia: Sri Lanka and Australia lock horns in the first of the two Tests starting 29 June at Galle
Head, a left-hand batsman and an occasional bowler, returned figures of 4-10 to match lead spinner Nathan Lyon's second innings wicket haul in Friday's three-day thrashing of the hosts at Galle.
South-westerly winds raging across the Indian ocean battered the port city, and upended broadcast equipment and one of the sightscreens at the ground