Canberra: Kurtis Patterson posted his maiden Test century as Australia finished on the front foot after Sri Lanka opener Dimuth Karunaratne was hospitalised after being struck by a bouncer on day two of the second Test.
Patterson (114 not out) marked just his second appearance with a hundred to help lead Australia to 534-5 declared in Canberra on Saturday.
Sri Lanka appeared to be comfortable on 82-0 before Karunaratne was felled by a Pat Cummins short ball and carried off the field on a stretcher at Manuka Oval.
Karunaratne - who scored 46 runs prior to the incident - was hit in the back of his neck in a terrifying moment, which stunned players and the crowd into silence.
It unnerved Sri Lanka, who lost 30-3 as the visitors lost Lahiru Thirimanne (41), replacement batsman Dinesh Chandimal (15) and Kusal Mendis (6) to be 123-3 at stumps, still 411 runs behind.
Earlier, Joe Burns (180) fell short of a memorable double-century and Patterson celebrated his maiden Test hundred as only one wicket fell in the first two sessions.
Australia were relentless as they resumed on 384-4 and piled on the runs against Sri Lanka, reaching 400 in less than 30 minutes of play.
Burns hit his 27th boundary and added nine to his overnight score before the opener chopped on to give Kasun Rajitha (1-103) his first wicket.
With Australia 404-5, Patterson - who was dropped from the first ball he faced on Friday and began the day on 25 - took over.
Making the most of his reprieve, Patterson was patient and calculated, bringing up his first Test half-century off 100 balls.
Australia captain Tim Paine watched from the other end as Patterson wore down Sri Lanka's attack, the 25-year-old raising his bat after hitting the three runs require for an unforgettable ton.
It also marked the first time in 30 years that two Australia batsmen have scored their first century in the same Test innings following Travis Head's hundred - dating back to Steve Waugh and Mark Taylor during the 1989 Ashes Tour.
Paine produced an unbeaten 45 before he declared and sent Sri Lanka in to bat before the tea break, which they navigated and looked set until Cummins (1-25), Nathan Lyon (1-40) and Mitchell Starc (1-32) struck late.