Sent into bat after the coin landed in Pakistan skipper Sarfaraz Ahmed's favour, Australia were off to a steady start with Warner and skipper Aaron Finch helping the team to 50 in 10 overs.
Australia seemed headed for a mammoth total as they were 223 for two in the 34th over but Amir's sensational spell changed the complexion of the game.
Amir started with a maiden and going with only four mainline bowlers, Australia knew they needed to score big to put Pakistan under pressure.
The Aussies broke free against Shaheen, with Finch hitting him over the deep square leg fence for a six and Warner employing the pull shot to get a four. As Australia looked for quick runs, Amir showed his class by bowling another maiden over.
Apart from the singles and twos, both managed to find the ropes occasionally, before Finch carted Mohammad Hafeez for 16 runs with the help of a six and two boundaries.
After a stand that yielded 146 runs in 22.1 overs, Amir provided Pakistan with the much-needed breakthrough when he had Finch hitting one high up in the air towards extra cover.
Warner hit Hasan Ali for two consecutive fours, and then, there was a classy cover drive by Steve Smith. A couple of quiet overs was followed by a productive one from Australia's point of view, with Warner smashing Shoaib Malik for a six over long-on and a four to pick 15 runs.
Sitting pretty at 189 for two in the 29th over, Smith tried to up the ante but in doing so, ended up giving a catch to Asif Ali, who had dropped a sitter in the slips earlier.
Glenn Maxwell struck 20 in 10 balls even as Warner reached the three-figure mark when an edge flew between the keeper and the wide slip for a four. He got out shortly after celebrating his century with gusto.