West Indies quick Shannon Gabriel claimed his best match figures in a Test but Sri Lanka recovered from a poor start to move into a strong position after Dinesh Chandimal pleaded not guilty to ball tampering on day four.
Chandimal was charged for allegedly taking sweets out of his left pocket and putting them in his mouth before applying the artificial substance to the ball on Friday.
The tourists took to the field two hours later than scheduled in protest on Saturday, but went straight out into the middle on the penultimate day and recovered from 48-4 to close on 334-8 - leading by 287 as they attempt to level the three-match series in St Lucia.
Kusal Mendis top scored with a classy 87, while Niroshan Dickwella made a quick-fire 62 and Chandimal chipped in with 39 as his side showed great character to take the upper hand.
Chandimal faces a hearing at the end of the Test and has the backing of Cricket Sri Lanka following an incident which has overshadowed what has become an enthralling contest at Darren Sammy National Cricket Stadium.
Gabriel took 5-59 in the first innings and the paceman was comfortably the pick of the Windies bowlers again with 6-57, but Sri Lanka batted superbly to set up an intriguing final day.
WIvSL: Shannon Gabriel dismissed Roshen Silva for his fifth wicket in the @OfficialSLC to become 1st @westindies bowler to take 10 wkts in a Test vs this opponent #Congratulations pic.twitter.com/dhCy0RpZDs— CricketWestIndies (@westindies) June 17, 2018
Sri Lanka looked in danger of suffering a series defeat with a day to spare when they lost three early wickets, a probing Gabriel snaring Kasun Rajitha leg before without scoring and Dhananjaya de Silva before Mahela Udawatte slapped a Kemar Roach delivery to Devendra Bishoo at short cover.
Mendis and Chandimal set about starting a rescue mission, the skipper showing his mettle in difficult circumstances to dig in as his partner played with freedom at the other end.
The elegant Mendis hit Roach into the leg side for two sixes in an entertaining knock and Chandimal rotated the strike before edging Roach (2-75) behind.
Mendis missed out on a deserved century when he chopped on to a delivery from the excellent Gabriel, who also removed Dickwella - but not before he had struck seven boundaries in a rapid half-century - and Roshen Silva (48), but it was very much advantage Sri Lanka at stumps.
|Cubs use five-run fifth inning to trump Cardinals|
|Manchester United 1 America 1: Mata salvages draw for Red Devils|
|Steelers´ Super Bowl window getting smaller - Brown|
|Neymar cares about PSG and will stay amid Real Madrid speculation|
|NFL, NFLPA at ´standstill agreement´ over anthem policy|
|Guardiola: It would´ve been a mistake for Jorginho to join City|
|Angels star Ohtani cleared to resume pitching|
|´I don´t give a f***´ – Cousins hits back at critics after Warriors move|
|Merritt leads Barbasol Championship|
|Ruud awakening for Ferrer in Bastad|
|Nibali withdraws from Tour de France with back fracture|
|Fabinho: I´ll try to convince Mbappe to join Liverpool|
|Beating Messi boosted France´s World Cup belief – Lloris|
|Carnoustie saving the worst until last|
|McIlroy´s youthful exuberance could be a bad sign for Carnoustie contenders|
|Saints triumph at second-placed Wigan|
|Anfield atmosphere sweetened Alisson on Liverpool|
|Bouchard reaches Gstaad quarter-finals|
|´What are you waiting for?´ - Alisson reveals Salah text messages|
|´Full package´ Alisson could not be missed - Klopp|
|Alisson to Liverpool: Brazil star becomes most expensive goalkeeper in history|
|Alisson to Liverpool: Brazilian´s stats blitz Mignolet, Karius|
|Liverpool sign Alisson in world-record deal|
|The Open 2018 diary: Spieth´s got ball skills as Finau proves the scratch golfer|
|Woods: Score doesn´t reflect how well I played|
|Can we go to Paris now? - Thomas in a hurry after conquering Alpe d´Huez|
|Thomas: I could have finished stronger|
|Kisner shines at baked Carnoustie as McIlroy, Rahm and Thomas loom|
|Sarri´s mentality made me a better footballer - Jorginho|
|Tax rates played a role in Ronaldo joining Juventus, says LaLiga president|
|Aggressive McIlroy doing it his way, not the fairway|
|I let him have it - Spinazzola ribs Ronaldo over Juve shirt number|
|Thomas makes it back-to-back wins|
|Ramos may remain for Spain but Luis Enrique promising surprises|
|Cazorla still playing through pain after Villarreal appearance|
|Vegas to Carnoustie - a hellish trip for Jhonattan|
|NFL training camp 2018: Five under-the-radar rookies to watch|
|Woods off to a flyer as Thomas charges|
|Sanchez given green light to join Man Utd tour|
|Greipel, Groenewegen and Gaviria latest sprinters to abandon Tour de France|
|Luis Enrique hopeful over Pique as he plots a Spanish evolution|
|I had a brain fart - Spieth disappointed with missed opportunity|
|I´ve sacrificed too much to quit, says injury-plagued Rossi|
|Klopp rejects Henderson´s plea to return early to Liverpool training|
|Open champion Spieth loses ground in scrappy finish|
|Alexis Sanchez hints visa issue sorted as United States trip beckons|
|Kovac an admirer of Pavard, expects James to stay|
|Dzeko happy at Roma and eyeing silverware|
|Eels win basement battle with Bulldogs|
|Kluivert to follow Totti´s example after taking ´big step´ with Roma|
|Kisner hopes to return Claret Jug favour to Spieth|
|FIBA bans 13 players & two coaches over Philippines-Australia brawl|
|Spieth and Rahm in the mix as Kisner sets the target|
|Monchi insists Roma remain ambitious as Liverpool close in on Alisson|
|Cavendish thanks ´race that shaped career & heart´ after cruel Tour exit|
|No Trent Bridge Ashes Test as England confirm schedule|
|Ajax tell Barcelona not even ´insane´ money will buy De Ligt, De Jong|
|Hamilton agrees two-year Mercedes extension|
|Uran withdraws from Tour after failing to shake off injuries|
|Spieth tees off Open defence|
|Zidane has shown no will to coach France, insists FFF president|
|Risking the curse - Steelers star Brown lands on Madden 19 cover|
|Pogba silenced his critics with World Cup displays – Ibrahimovic|
|Warburton overwhelmed by support following retirement|
|Wilshere excited by tactics of Wenger-like Pellegrini|
|Deschamps never considered France exit prior to World Cup win|
|Persepolis eye Champions League after Iran impress at World Cup|
|Sandy Lyle gets The Open underway at Carnoustie|
|Roosters sign England international Hall|
|Ovechkin, Kim earn major honours at ESPY Awards|