Overnight batsmen Usman Khawaja (26) and Steve Smith (30) didn’t last long against Herath’s spin, as Australia faltered after starting the day 66 for two in response to Sri Lanka’s 117 all out inside 35 overs on Tuesday.
The veteran left-arm spinner had notched up 4-35 at lunch, after dismissing opener Joe Burns (3) on the first day.
Smith added just two runs to his overnight score, before being foxed by a cleverly disguised widish delivery from Herath, as wicketkeeper Dinesh Chandimal completed an easy stumping.
Herath then trapped Khawaja lbw, with the top-order batsman adding just one run to his overnight tally.
With Australia 70 for four, Adam Voges and Mitchell Marsh (31) then stitched together a 60-run partnership for the fifth wicket.
Debutant bowler Lakshan Sandakan made the crucial breakthrough by deceiving Marsh with a delivery that went the other way.
Herath, returning for his second spell of the morning, claimed his fourth scalp when wicketkeeper Peter Nevill (2) was caught at mid-on by Kusal Perera.
Adam Voges (41 not out) battled hard to establish a respectable lead for the visitors, with Steve O’Keefe (3 not out) at the other end.
Play started 15 minutes earlier at Pallekele Stadium on Wednesday to make up on time lost on day one on Tuesday, when rain washed out the entire final session.