The victory is only the second for Sri Lanka against Australia in 27 tests. Australia has won 17.
Sri Lanka was bowled out for 117 runs in its first innings and Australia gained an 86-run lead by scoring 203 in its first innings.
Mendis hit 176 to turn Sri Lanka’s fortunes around as the hosts scored 353 in its second innings. Herath took nine wickets in the match.
Sri Lanka 1st Innings: 117 (Dhananjaya de Silva 24; Nathan Lyon 3-12, Josh Hazlewood 3-21)
Australia 1st innings: 203 (Adam Voges 47; Rangana Herath 4-49, Lakshan Sandakan 4-58)
Sri Lanka 2nd innings: 353 (Kusal Mendis 176; Mitchell Starc 4-84)
Australia 2nd Innings: 161 (Steve Smith 55; Rangana Herath 5-54, Lakshan Sandakan 3-49)
Sri Lanka spin their way to brilliant win over Australia