Spinner Nathan Lyon claimed five wickets as Australia bowled out Sri Lanka for 212 on a turning pitch at Galle in the opening Test on Wednesday.
Wicketkeeper-batsman Niroshan Dickwella made a defiant 58 before the Sri Lankan innings folded in the third session of a fast-moving game on the opening day of the two-match series.
Fast bowlers Pat Cummins and Mitchell Starc struck early with a wicket each as Sri Lanka took lunch at 68-2. The spinners soon took charge on a pitch traditionally known to a assist the slow bowlers.
The left-handed Dickwella counter-attacked during his 59-ball stay at the crease and put on key partnerships, including a 54-run stand with Ramesh Mendis, who made 22, for the seventh wicket.
Dickwella reached his fifty off 42 balls in the second session but Lyon got him out soon after, also sending back Mendis after tea.
Lyon got his fifth wicket in Lasith Embuldeniya and Swepson ended the innings after 59 overs.
Earlier, Swepson struck on successive balls to get Dhananjaya de Silva, for 14, and Dinesh Chandimal, for nought, as David Warner held on to a juggling catch after the ball deviated from the wicketkeeper's glove.
But the off-spinner came back strong in his next over to dismiss Angelo Mathews, for 39, and ended a 42-run stand for the sixth wicket.
Australia were unchanged from the team that secured a 1-0 series win over Pakistan in March.
Sri Lanka, who whitewashed the tourists 3-0 in 2016, handed leg-spinner Jeffrey Vandersay his Test debut.
The island nation, which won the one-day international series against Australia 3-2, is battling an unprecedented economic crisis, with people across the country struggling to pay for food, fuel and other necessities.