Set 471 for victory, the Bulls charged to the target five wickets down as former Test No.3 Khawaja showed his batting class with a superb unbeaten 182 in 461 minutes.
It capped an amazing comeback as the Redbacks - with scores of 403 and 6(dec)-202 - failed to enforce the follow-on after bowling Queensland out for 135 in their first innings on day two.
The Bulls lost only three wickets on the final day as the South Australian attack gained little help from a fine batting pitch.
The five-wicket win keeps the Bulls' teetering Shield campaign alive as they jump to 16 points - eight behind joint front-runners NSW and the Redbacks.
Their stunning effort was easily the Bulls biggest successful run-chase and only ranks behind South Australia's 6-506 against Queensland in 1990-91 as the largest ever.
Resuming with his team 2-170 on the fourth morning, Khawaja batted with great patience to thwart the Redbacks attack before lifting his tempo after lunch.
The Pakistan-born left-hander gained great early support from an ultra-cautious Peter Forrest (35) after Joe Mennie dismissed Nick Stevens in the third over of the day.
The pair put together just 45 runs for the first session but the tempo of the innings built through the day in a highly-professional and beautifully measured approach.
Queensland skipper James Hopes (58 off 63 balls) then played a pivotal role in a momentum-turning 114-run stand with Khawaja.
While watchful early, Khawaja lashed the Redbacks attack to all parts of the ground after tea when the hosts needed 163 off 36 overs in the last session
They did it easy, with 8.4 overs to spare, as Khawaja brought up the winning runs with his 23rd boundary with wicketkeeper Chris Hartley (48 not out) at the other end in his 100th first-class game for Queensland.