At stumps, Sri Lanka were 123 for three in reply with Kusal Perera on 11 and Dhananjaya de Silva not out one. Paine's declaration looked premature given the ease with which Sri Lanka's openers weathered the new-ball attack led by under-pressure Mitchell Starc.
On a flat Manuka Oval track Karunaratne and Lahiru Thirimanne saw off some lightning quick deliveries and a bouncer barrage and had built an 82-run stand before disaster struck. Playing in his 58th Test, Karunaratne was 46 not out when a rising Pat Cummins ball glanced off his shoulder and onto his helmet, close to the neck area.
He slumped to the ground, dropping his bat as Australian players ran to assist. A doctor and physio sprinted onto the ground and called for more medics and after some 10 minutes, he was put on a stretcher and taken off the field on a golf buggy. Cricket Australia said he complained of pain in the neck and tingling to the hands and was ferried to hospital.
Coach Chandika Hathurusingha said later he was in "good spirits" and "in no danger". "It hit on the back of the neck so he is being assessed," he added. It clearly unsettled Thirimanne who fell to spinner Nathan Lyon for 41 in the next over, caught by Usman Khawaja at slip.
Cummins then clean-bowled Kusal Mendis for six and when captain Dinesh Chandimal gloved a Starc ball to Paine behind the stumps for 15, the tourists were in trouble. "We lost a couple of wickets afterwards so it was definitely a distraction." admitted Hathurusingha.
The impressive Kurtis Patterson was not out 114 and Paine on 45 at the declaration with Vishwa Fernando the pick of the Sri Lankan bowlers with 3-126. After being dropped on his first ball, Patterson, who earned a debut in the first Test at Brisbane after hitting 157 and 102 for a Cricket Australia XI in a warm-up against Sri Lanka, never looked back.
The New South Welshman shored up his credentials ahead of an Ashes tour to England later this year by bringing up his maiden hundred with a drive to mid-off for three after starting the day on 25. "It's another nice milestone. I've played that innings in my mind ever since I was a little boy," said Patterson.
"More importantly, it just put the team in a position to win another Test match." Following a century drought stretching back to October when Khawaja scored 141 against Pakistan in Dubai, it turned into a flood in Canberra with three players bringing up the magical mark. Opener Joe Burns punished the inexperienced Sri Lankan attack on Friday in a 308-run stand with Travis Head (161), carrying his bat through the day.
But he only lasted five overs Saturday after resuming on 172, adding eight runs before chopping a delivery from quick Kasun Rajitha onto his stumps. He trudged off dejected after missing a glorious chance to notch a first Test double century against a team missing its three first-choice pace bowlers - Suranga Lakmal, Lahiru Kumara and Dushmantha Chameera - through injury.
Burns' departure brought the consistent Paine to the crease, who kept the pressure on the visitors, still reeling after being beaten at the first Test in Brisbane by an innings and 40 runs. At the other end Patterson grabbed his chance with both hands, smashing 14 fours and a six in his breakthrough knock.
Scoreboard
Australia 1st innings (overnight 384-4; T. Head 161)
==============================================
J. Burns b Rajitha 180
K. Patterson not out 114
T. Paine not out 45
----------------------------------------------
Extras: (lb3 nb10, w4) 17
==============================================
Total (five wickets declared; 132 overs) 534
==============================================
Did not bat: Pat Cummins, Mitchell Starc, Jhye Richardson, Nathan Lyon
Fall of wickets: 1-11 (Harris), 2-15 (Khawaja), 2-28 (Labuschagne), 4-336 (Head), 5-404 (Burns)
Bowling: Rajitha 28-5-103-1, Fernando 30-3-126-3, C. Karunaratne 22-0-130-1, Perera 32-4-112-0, De Silva 20-2-60-0
==============================================
Sri Lanka 1st innings
==============================================
D. Karunaratne retired hurt 46
L. Thirimanne c Khawaja b Lyon 41
D. Chandimal c Paine b Starc 15
K. Mendis b Cummins 6
K. Perera not out 11
D. de Silva not out 1
----------------------------------------------
Extras: (lb2, b1) 3
==============================================
Total: (3 wkts; 43 overs) 123
==============================================
To bat: Niroshan Dickwella, Dilruwan Perera, Chamika Karunaratne, Vishwa Fernando, Kasun Rajitha
Fall of wickets: 1-90 (Thirimanne), 2-101 (Mendis), 3-120 (Chandimal)
Bowling: Starc 8-2-32-1, Richardson 9-4-23-0, Cummins 10-2-25-1, Lyon 16-5-40-1
Toss: Australia
Umpires: Richard Illingworth (ENG), Michael Gough (ENG)
TV umpire: Marais Erasmus (RSA)
Match referee: Javagal Srinath (IND).