Skipper Tim Paine waved his players back into the pavilion at 589 for three ahead of the second day’s dinner break with Warner on the 10th highest Test score ever, also a personal best.
The decision to declare deprived him of a crack at Brian Lara’s all-time high 400 not out, but it proved to be the right one with the Australian bowlers quickly tearing through Pakistan’s hapless top order under the Adelaide Oval lights.
They finished in deep trouble at 96 for six with Mitchell Starc grabbing four of them.
Babar Azam was not out 43 and Yasir Shah was on four.
The visitors, who have lost 13 consecutive Tests in Australia, enjoyed little success in a long day in the field as they look to avoid a 2-0 series defeat.
But they did remove Marnus Labuschagne for 162 in the opening session and also bagged Smith, caught behind by Mohammad Rizwan off Shaheen Afridi for 36.
In making his runs, Smith — who had a rare failure in the first Test at Brisbane — shattered a record that had stood since 1946.
He took a single off Muhammad Musa to reach 7,000 runs in his 126th innings, taking possession of a mark held for 73 years by English great Wally Hammond who reached the milestone in his 131st innings.
Smith also moved past legendary countryman Donald Bradman’s 6,996 Test runs to become Australia’s 11th highest scorer.
The home team resumed the day at 302 for one with Warner on 166 and Labuschagne 126, with the pair putting on another 67 runs before Pakistan finally got a breakthrough.
Skipper Azhar Ali took the new ball and Afridi clean-bowled Labuschagne as he attempted a drive, just as he and Warner appeared set for another long day at the crease.
The 25-year-old, who has come of age during the series, trudged back to the pavilion to a standing ovation after a classy 162, his second century in a row.
Their marathon 361-run partnership was a record second-wicket stand for Australia against Pakistan and the highest ever in a pink-ball Test.
Just minutes later, the explosive Warner completed only the second Test double century of his career. Playing in his 81st Test, he reached 200 with a single from Afridi, having clattered 23 fours along the way.
Pakistan thought they finally had him out on 226 when he was caught in the gully off debutant Musa, only for their heads to drop when it was called a no-ball.
Warner made them pay, passing his previous highest Test score of 253, set in Perth in 2015, before reaching a triple century off 389 balls to join an elite club.
He raced to 335, one more than former captain Mark Taylor’s epic 334 against Pakistan in 1998 and Donald Bradman’s 334 against England in 1930, before Paine decided to unleash his bowlers, conscious that periodic rain is forecast for the next two days.
Exhausted, Warner was given a standing ovation with his knock the second best score ever by an Australian after Matthew Hayden’s 380 against Zimbabwe in 2003.
Matthew Wade remained unbeaten on 38.
Facing a tough last session under lights, Pakistan’s batsmen quickly caved in.
Starc removed Imam-ul-Haq, who got a thick edge to Warner on two, before Pat Cummins had Azhar caught for nine.
Josh Hazlewood accounted for Shan Masood before Starc nabbed Asad Shafiq, Iftikhar Ahmed and Rizwan cheaply.