Khawaja (232), milestone man Steve Smith (141) and debutant Josh Inglis (102) made life hell for the hosts, who face the daunting task of replying to Australia's 6-654 declared on a Galle pitch tipped to deteriorate plenty.
By the time Australia declared with an hour to play on day two on Thursday, they had eclipsed their previous highest-scoring innings on the subcontinent - 617 on the tour of Pakistan in 1980.
Alex Carey (46no) and Mitch Starc (19no) were unbeaten at the crease when Australia closed their innings.
Josh Inglis raises his arms after reaching his century in his debut Test match against Sri Lanka. (AP PHOTO)
Veteran opener Khawaja silenced the critics who came out in force during a tough summer, and surely extended the lifespan of his long career with his first Test double hundred.Â
Khawaja was dropped twice and would have been out caught behind if Sri Lanka had used a review on day one, and was nearly run out at the non-striker's end when he strayed from his crease early on Thursday.
But his fortune finally ran out in the second session, edging Prabath Jayasuriya (3-193) to gloveman Kusal Mendis and immediately walking.
Khawaja left in good company: Donald Bradman is the only other Australian to reach 200 runs in a Test innings after his 38th birthday.
Once lambasted for his track record against spin, Khawaja reverse-swept often and effectively across the 352 deliveries he faced on a pitch offering limited bounce.
He found the gap between fielders throughout the innings, and passed his previous high score (195no) by hitting Jayasuriya past cover for four in the first session.
The veteran raised a fist to the air as he snuck a single at mid-off to reach 200, kneeling on the ground and kissing the turf.
It was a slightly smaller Galle crowd to the one that attended day one to see Smith pass 10,000 runs, but the punters nevertheless rose to applaud Khawaja under the historic city's clearest skies of the week.
Inglis vindicated his selection as a specialist batter at the expense of teen sensation Sam Konstas, speeding his way to triple figures from only 90 deliveries.
Josh Inglis looked right at home in his debut Test innings for Australia. (AP PHOTO)
His aggression and proficiency against spin were on full show as he became the first Australian debutant to score a century since Adam Voges in 2015.
A six from Jeffrey Vandersay (3-182) over long on was a particular highlight, before Inglis edged Jayasuriya to cover.
After opting not to review two would-be wickets on day one, the hosts finally figured out the DRS and sent an lbw shout upstairs to end Smith's blistering innings.
Vandersay struck Smith's right leg as he lunged forward to defend, and Ball Tracker showed the legspinner's delivery striking the top of off stump.
Smith raised his bat to the crowd at the end of an innings that could have finished on one had Jayasuriya held on from his own bowling.
Steve Smith walked off the field with 10,140 Test runs to his name. (AP PHOTO)
Instead, Smith continued to wreak havoc on day two and passed Sunil Gavaskar into 13th place on the all-time Test run-scorers list with a six over long on.
Smith has now scored 10,140 runs in the baggy green.
His 266-run stand with Khawaja was Australia's largest third-wicket stand on the subcontinent in Test history, and the fifth-largest for the third wicket all up.