Former paceman Nuwan Zoysa was the first Sri Lankan to claim a test hat-trick, against Zimbabwe in a 1999 match at Harare.
Herath had troubled Australia in the first test at Pallekele too, exposing the visitors' vulnerability against spin bowling and claiming nine wickets in Sri Lanka's 106-run victory.
The 38-year-old returned to haunt them again on the second morning, bowling captain Steve Smith for five runs with the first delivery of his third over.
Smith could have been dismissed in Herath's previous over but Dinesh Chandimal fluffed a regulation stumping chance.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
Herath then ripped the heart out of Australia's batting in his eventful seventh over, inducing Voges into a drive with his fourth delivery and Dimuth Karunaratne took a brilliant catch at extra cover to complete the dismissal.
His next delivery was an arm ball that trapped Nevill plumb in front and Herath struck Starc's pad with his next delivery but the leg-before appeal was turned down.
After a brief chat with the spinner, home captain Angelo Mathews decided to review the decision and Herath, who claimed 4-35, was mobbed by team mates as the not-out decision was overturned.
(Reporting by Amlan Chakraborty in New Delhi; editing by Greg Stutchbury)
