Ireland 492 (Campher 111, Stirling 103, Jayasuriya 5-174) and 54 for 2 (Moor 19, Balbirnie 18*) trail Sri Lanka 704 for 3 dec (Kusal 245, Madushka 205, Mathews 100*, Hume 1-87) by 158 runs
Galle: Ireland face a final-day battle to save the second Test against Sri Lanka in Galle after the hosts declared on a mammoth 704-3 in their first innings.
That left them with a 212-run lead and the tourists then lost two wickets to stand at 54-2 - still 158 runs adrift.
Kusal Mendis (245) and Nishan Madushka (205) both fired double centuries with captain Dimuth Karunaratne hitting 115 and Angelo Mathews making 100 not out.
Irish openers James McCollum and Peter Moor then both departed cheaply.
Captain Andrew Balbirnie and Harry Tector guided the tourists to the close but the Irish know that they will have to bat well into the final day to save the contest despite having hit their country's highest runs total of 492 in their first innings.
The hosts' top four batsmen all hit hundreds for only the third time in Test history.
Sri Lanka won the first of the two-match Test series by an innings and 280 runs.
The home side's declaration came after tea on day four against an Irish side who have lost all five of their previous Test matches.
Madushka converted his maiden Test century into a double hundred, becoming the second-youngest Sri Lankan to score a Test 200 after Mahela Jayawardene.
He was dismissed for 205 in the third over after lunch, lbw to Andy McBrine, with Ireland successfully reviewing the decision after the initial appeal was turned down.
Madushka's marathon knock lasted six minutes short of eight hours after he faced 339 deliveries and hit 22 fours and a six.
Mendis, who had twice been dismissed in the 190s, reached his first Test 200 by pushing a Ben White delivery behind square to steal a single.
He amassed 245 runs and was one short of Wasim Akram's world record of 12 sixes in a Test innings when he was caught at long-off attempting to equal that mark.
Mathews was dismissed for a duck in the first Test and was put down on one this match, but made the most of his reprieve to post his 16th Test hundred.
That gave the hosts their quadruple-centurions entry in the history books and captain Karunaratne, who scored 115 on Wednesday, declared immediately.
As Ireland went in to bat, Ramesh Mendis cleaned up McCollum for 10 before Jayasuriya had Moor caught at short extra cover.
Balbirnie and Tector took Ireland to stumps without further trouble, with the captain on 18 not out and Ireland's number four on seven.