Colombo - Australia's James Faulkner recorded his first hat-trick in one-day internationals but Sri Lanka still managed to post a challenging 288 in their second match in Colombo on Wednesday.
Sri Lanka, who chose to bat first, rode on half-centuries from skipper Angelo Mathews, Kusal Mendis and Kusal Perera to put up a respectable score in 48.5 overs against a persistent bowling attack.
The hosts lost two wickets in two balls after paceman Mitchell Starc struck early to send opener Danushka Gunathilaka trudging back to the pavilion.
Off-spinner Nathan Lyon, who shared the new ball with Starc, then bowled the veteran Tillakaratne Dilshan for 10 to have the hosts in trouble at 12 for two.
But in-form batsmen Mendis and Dinesh Chandimal put together a 125-run third wicket partnership to build a solid platform for the hosts at the R Premadasa Stadium.
Mendis, who followed up his 67 in the first ODI with a run-a-ball 69, hit nine boundaries and forced Australian skipper Steve Smith to use seven bowlers until the 21st over.
The pair put quick runs on the board before a triple strike by leg-spinner Adam Zampa checked the hosts' surge.
Chandimal, who top-scored with an unbeaten 80 in the previous game, was denied his sixth consecutive ODI fifty after Zampa trapped him lbw for 48.
The wicketkeeper-batsman was adjudged not out by the on-field umpire but Australia successfully reviewed the decision.
Zampa, 24, struck again in his very next over to get another lbw shout in his favour, but this time danger man Mendis was plumb in front of the wicket.
The leggie also accounted for Dhananjaya de Silva to leave Sri Lanka struggling on 158 for five but the hosts were rescued by another crucial partnership between Mathews, who scored 57, and Kusal Perera who made 54.
Their 103-run sixth-wicket stand entertained a raucous home crowd as they smashed the bowlers to all parts of the ground.
Mathews, who recorded his 32nd ODI fifty in his 178th match, struck a four and two sixes during his 60-ball stay at the crease.
But Faulkner hit Sri Lanka hard after getting Kusal Perera with the last delivery of his eighth over. He came back to dismiss Mathews and Thisara Perera to complete his hat-trick.
Starc (3-53) claimed two wickets in the final over to stop Sri Lanka from reaching the 300-run mark, with the hosts losing their last five wickets for 27 runs.
Sri Lanka are trailing the five-match ODI series 1-0.