The left-hander struck a timely 144 as Australia scored 269 on Tuesday, the third day in reply to the home side's 427.
At tea, Bangladesh were 41 for no loss in their second innings after gaining a 158-run lead. First innings centurion Shahriar Nafees (28) and Javed Omar (eight) were the not out batsmen.
Australia, who came here after a 3-0 Test series triumph in South Africa, suffered a batting collapse on the second day but Gilchrist produced a fine knock under pressure.
Gilchrist, 51 overnight in a score of 145-6, batted with purpose to take his team past the target of 228 to avoid batting again.
The 34-year-old completed his 16th ton in 84 Tests with a drive through the covers off part-time spinner Rajin Saleh and continued to plunder runs in the company of tailenders.
He smashed 14 fours and six huge sixes, much to the home side's frustration.
Gilchrist added 73 valuable runs with Jason Gillespie (26) for the eighth wicket and 39 with Stuart Clark (zero) for the next, forcing the Bangladesh bowlers to end up bowling a restrictive line and length.
Gilchrist, who on Monday passed 5,000 runs in Tests, helped Australia to wriggle out of an embarrassing position as Bangladesh have never managed to give a follow-on to any team since gaining Test status in 2000.
For the home side, left-arm spinner Mohammad Rafique worked hard to bag his seventh five-wicket haul in 25 Tests, which included the prize scalp of Gilchrist.
Rafique finished with 5-62 as Gilchrist became the last man out for the Aussies when he holed out to Shahadat Hossain at deep mid-wicket.
The second and final Test will be held in Chittagong from Sunday. The Test series will be followed by a three-match One-day series.