Herath finished with remarkable figures of 7-157 on an unhelpful pitch, his last wicket giving him 100 Test scalps in 29 matches.
Resolute Sri Lankan batting and bad weather frustrated Australia’s bid for a series-clinching win as the second Test ended in a draw in Pallekele on Monday.
Jayawardene and Angelo Mathews (95) were stoic in a stand of 142 for the sixth wicket that dragged the hosts back from 68-5 to briefly threaten the most stunning of fightbacks.
Australia won by 125 runs
Sri Lanka Test squad against Australia: 1. Tilakaratne Dilshan (captain) 2. Tharanga Paranavitana 3. Kumar Sangakkara 4. Mahela Jayawardene 5. Thilan Samaraweera 6. Prasanna Jayawardene 7. Angelo Mathews 8. Suraj Randiv 9. Suranga Lakmal 10. Chanaka Welagedara 11. Dhammika Prasad 12. Shaminda Eranga 13. Lahiru Thirimanne 14. Seekkuge Prasanna 15. Ajantha Mendis 16. Rangara Herath The Test series begins in Galle on 31 August.
Malinga removed Mitchell Johnson, John Hastings and Xavier Doherty to become the first bowler to take three hat-tricks in one-dayers as Sri Lanka dismissed Australia for 211 before achieving the target with three overs to spare.
Sri Lanka won by 4 wickets
Debutant leg-spinner Seekkuge Prasanna dismissed Marsh and the Hussey brothers, Michael and David, in the space of four deliveries, but Australia needed just 10 runs to win with five wickets in hand at that stage.
Australia won by 5 wickets
Upul Tharanga hit a century and paceman Lasith Malinga grabbed five wickets as Sri Lanka posted a crucial 78-run win over Australia in the third one-day international on Tuesday.
Sri Lanka won by 78 runs
Australia produced another clinically efficient performance to beat Sri Lanka by eight wickets in the second one-day international at the Mahinda Rajapaksa Stadium and take a 2-0 lead in the five-match series on Sunday.
Australia won by 8 wickets