Ahmed, who scored his first hundred in Sri Lanka two months ago, fell in the last over before tea, stumped off spinner Nathan Lyon for 109. He batted for 148 minutes and hit 14 boundaries in all, completing his hundred off just 80 balls to record the fourth fastest ton by a Pakistani.
Ahmed said that he played his natural game, adding that if this century helps the team win then he would be happier. He said that Pakistan would come back the next day through their bowlers and if they manage a good lead then its better, Sport24 reported.
Pakistan added 235 runs after resuming on their overnight score of 219-4 with Ahmed, Misbah-ul Haq and Asad Shafiq all coming good on a flat pitch which had little for the bowlers. Ahmed added an important 124 runs for the sixth wicket with Asad Shafiq (89) to build the innings after Shafiq added 93 with skipper Misbah, who made 69.
Misbah, under pressure to score after managing just 67 in the 2-0 Test defeat in Sri Lanka two months ago, hit two fours and two sixes during his 255-minute stay at the crease. Lyon was unlucky not to have dismissed Shafiq off the first ball of the day's second over when Alex Doolan failed to catch a bat-pad push at forward short-leg.
Shafiq fell short of his hundred by 11 runs as he holed out to Steve O'Keefe, the left-armer's first Test wicket, after hitting five fours and two sixes during his 151-ball stay. Johnson, who delivered match figures of 3 for 39, led a hapless Australian attack with left-arm spinner O'Keefe struggling to take 2-107 while Lyon toiled hard for 1-148 in 36.4 overs.
As Australia took to the crease, their openers fought back brilliantly. Opener David Warner smashed a quick-fire 75 and Chris Rogers was on 31 to take their side to 113 without loss at close of play on the second day, trailing by 341 runs with all ten wickets standing.
Warner hit seven fours and a six in his eighth Test half-century, his sixth in succession, as Australia matched Pakistan's batting. Pakistan could have removed Rogers on 13 in left-arm spinner Zulfiqar Babar's first over but Younis Khan failed to hold a straightforward catch in the slips.