Australia celebrate their victory in the first Test against Pakistan at the Gabba in Brisbane

Brisbane (Australia) (AFP) - Australia went one up in their two-Test series against Pakistan when they won the first Test by an innings and five runs at the Gabba in Brisbane on Sunday.

After beginning their second innings 340 runs behind Australia and then losing three cheap wickets in the afternoon session on Saturday, the Pakistanis put up stern resistance Sunday before finally succumbing late in the final session.

Babar Azam scored a magnificent century and Mohammad Rizwan fell five runs short of his first as Pakistan were dismissed for 335 late on the fourth day.

Leg-spinner Yasir Shah also made his highest Test score with a fighting 42 to allow the Pakistanis to head to the second Test in Adelaide with some momentum despite the loss.

But there was to be no denying an Australian attack on Sunday which probed and struck at vital moments, whenever Pakistan seemed to be getting the upper hand.

Josh Hazlewood was the pick of the Australian bowlers with 4-63, while Mitchell Starc took 3-73, Pat Cummins 2-69 and Nathan Lyon 1-74.

Earlier, Azam reached his second Test century – and his first in Australia – with an impressive knock.

The elegant right-hander had been in excellent form in the lead-up games, but was out to a disappointing shot in the first innings for just one.

He was a different player in the second innings, however, and never looked in trouble until he edged Nathan Lyon to wicketkeeper Tim Paine to fall for 104.

Pakistan's Babar Azam ducks under a bouncer on his way to a century against Australia

He shared partnerships of 68 with Shan Masood and 132 with Rizwan as Pakistan battled hard throughout the first two sessions.

Rizwan, playing just his second Test, brought up his first half-century off 86 balls with nine boundaries.

He batted with real commitment and looked certain to bring up his maiden Test century until on 95 he tried to upper cut a Hazlewood short ball only to steer it straight to Nathan Lyon at third man.

Yasir Shah continued to hit out, but with only the fast bowlers for company it was only a matter of time before the Australians wrapped up the win.

After resuming their second innings at 64 for three at the start of day four, Masood and Azam showed great commitment to frustrate the Australian attack.

The Pakistan pair looked comfortable from the beginning and brought up their 50-run partnership midway through the first hour’s play.

But on 42 Masood tried to hook a Pat Cummins short ball and got a thin edge to Australian wicketkeeper Paine to leave the visitors 93 for four.

One run later Paine was in the action again when new batsman Iftikhar Ahmed was squared up by a beautiful ball from Josh Hazlewood and could only manage to edge it through to the Australian captain.

Rizwan and Azar kept the momentum going, but once Azar fell Pakistan were always up against it.