Batting at No 8, the off-spin bowling all-rounder posted his second-highest Test score, following his 108 not out against Sri Lanka at Headingley last year, and saw England past 400, which would have been the aim of captain Alastair Cook when he he won the toss and batted on Wednesday.
Mitchell Starc led Australia's attack with five for 114 in 24.1 overs -- his third five-wicket Test haul and first abroad.
But fellow left-arm fast bowler Mitchell Johnson -- whose 37 wickets were central to Australia's 5-0 Ashes rout of England in 2013/14 -- bowled 25 wicket-less overs for 111 runs.
England resumed on their overnight 343 for seven after Joe Root's well-made 134 had rescued them from the depths of 43 for three.
Also Read
Ali was 26 not out and Stuart Broad unbeaten on nought, with blue skies on a sunny day promising good conditions for batting.
It was Broad, however, who took the attack to Australia by driving Josh Hazlewood for four and pulling him for six although the paceman's first over of the day saw the batsman, who has struggled against the short ball, duck into a delivery that hit him on the badge of his helmet.
Broad, heavily criticised in Australia for not 'walking' during the first Ashes Test at Trent Bridge in 2013, appeared happy to go on this occasion.
However, the on-field umpires told him to wait while they asked third umpire Chris Gaffaney to check if the catch was clean.