Head and Labuschagne put Australia in command
Australia batsmen Travis Head and Marnus Labuschagne
Travis Head and Marnus Labuschagne made their highest Test scores while Pat Cummins struck with the last ball on day two to put Australia on course for victory over Sri Lanka at the Gabba.
A fifth-wicket stand of 166 between Head - who made 84 after being dropped on 29 - and Labuschagne (81) put Australia firmly on top before Suranga Lakmal claimed a third five-wicket Test haul in an eventful final session.
Lakmal finished with 5-75 as Australia lost their six wickets for 75 runs to post 323 all out in reply to Sri Lanka's meagre 144 in Brisbane.
The tourists - without Lahiru Kumara for a long spell in the field due to injury - were in deep trouble on 17-1 at stumps – still trailing by 162 - after Cummins removed Dimuth Karunaratne under the lights.
Sri Lanka were in need of early wickets when Australia resumed on 72-2 and they picked up two in quick time, Marcus Harris (44) cutting Kumara to Lahiru Thirimanne at point before Lakmal removed nightwatchman Nathan Lyon.
Head and Labuschagne consolidated, however, finding the gaps and rotating the strike well, and Australia moved into the lead when the former stylishly eased Lakmal through midwicket.
Yet their stand should have ended in the first over after the break when Head nicked Lakmal behind, but wicketkeeper Niroshan Dickwella was unable to hang on with one hand.
Head moved to 50 courtesy of a mistake in the field and the confident Labuschagne raised his bat for the first time at Test level, both players prospering during their century partnership.
They continued to tick along in obdurate fashion until Labuschagne threw his wicket away, offering a simple chance to Thirimanne at short mid on attempting to hit Dhananjaya de Silva over the top.
Australia ended the second session in a strong position on 249-5 and Head moved into the 80s with a classy back-foot drive when Lakmal got his line slightly wrong, but Sri Lanka's spearhead made an impact with the second new ball in his next over.
The paceman got one to shape back in and trap Head lbw and then saw off Tim Paine with his next delivery, Kusal Mendis diving forward to take a fine catch.
Kumara was absent due to a combination of back and hamstring troubles, but Dushmantha Chameera came back following a short spell off the field to get Cummins caught behind for a 21-ball duck.
Debutant Kurtis Patterson - who made two hundreds for a Cricket Australia XI against Sri Lanka last week - looked assured at the crease in reaching 30 until he became Lakmal's fifth victim.
Mitchell Starc smashed a rapid unbeaten 26 before Cummins had the final say, conjuring up a peach of a delivery to get Karunaratne caught behind and leave the home team heading into Australia Day scenting an emphatic victory.