Ireland posted their highest Test score of 492 on Tuesday as Paul Stirling and Curtis Campher became only the third and fourth Irishmen to post centuries in cricket's longest format.
Bowled out just before tea on day two of the second Test against Sri Lanka in Galle, Stirling scored 103 and Campher 111 after captain Andy Balbirnie made 95 on day one.
Lorcan Tucker scored a useful 80 while Prabath Jayasuriya, the home hero of the first Test, took five wickets for 174. Asitha Fernando and Vishwa Fernando took two wickets each.
Ireland only gained Test status in 2017 and have lost all five games so far.
The previous highest Test score was 339 against Pakistan in their inaugural match in 2018.
In punishingly hot and humid conditions, Stirling had retired hurt with cramps on Monday after reaching 74, but came back to the crease on Tuesday after Tucker fell.
Stirling reached his maiden Test hundred in style, upper-cutting Asitha Fernando for six over deep point. He now has centuries in all three formats of the game.
Soon afterwards the same bowler dismissed Stirling for 103 as the batsman hooked a short delivery into the hands of Dhananjaya de Silva on the fine-leg boundary.
Campher was well caught by a diving De Silva at first slip to give Jayasuriya his third wicket in the innings.
Ireland lost the first Test by an innings and 280 runs.