Gillespie, whose previous Test best was 54 not out, ended on 201 not out -- a record for a nightwatchman -- as Australia declared on 581-4 in reply to Bangladesh's first-innings 197.
At tea Bangladesh were 67-1 after conceding a 384-run first innings lead. Opener Shahriar Nafees (19) and captain Habibul Bashar (17) were the not out batsmen.
Gillespie and Michael Hussey, who also achieved a career-best innings, allowed the tourists to declare just 25 minutes after lunch. They had plundered runs at will in the morning session after resuming on 364-3.
Gillespie, who had completed his maiden ton on Tuesday, batted on with ease and his fourth-wicket stand with Hussey (182) was worth 320. Gillespie's innings lasted 425 balls and included 26 fours and two sixes.
He got past 200 with a glance off left-arm spinner Mohammad Rafique and went back to the pavilion with his hands raised and nodding his head in disbelief, as captain Ricky Ponting made the declaration.
The previous highest mark for a nightwatchman was set by Tony Mann (105) of Australia against India at Perth in 1977.
Hussey got to his fourth century in 11 Tests with a drive through covers off paceman Shahadat Hossain and went on to surpass his previous highest of 137 against the West Indies in Hobart last year.
Hussey, 93 overnight, smashed 21 fours and a six off 203 balls before holing out to Hossain at the square-leg fence off part-time seamer Aftab Ahmed in a bid to step up the run-rate.
In reply, Bangladesh lost opener Javed Omar (19) early as Brett Lee trapped him leg-before. But Bashar survived an easy chance on zero when Shane Warne dropped him at slip off Gillespie.
Australia won the first game in the two-Test series by three wickets.