Ahmed fell in the last over before the interval for 109 after scoring his second Test hundred.
Zulfiqar Babar was seven not out as Pakistan plundered 235 runs in the two sessions on a flat Dubai stadium pitch.
Earlier Misbah-ul Haq scored 69 and Asad Shafiq made 89.
Mitchell Johnson took 3-39 while left-arm spinner Steve O’Keefe had figures of 2-107.
The second and final Test will be played in Abu Dhabi from October 30.