Australia has the last laugh, wins first Test by 39 runs

Australia captured Pakistan's last two wickets to win the first day-night Test in Brisbane by 39 runs before Tea on day five on Monday but the touring side won huge admiration for its dogged fourth innings chase.

Australia , 1st Test, v Pakistan

Australian team celebrates after winning a thrilling Test against Pakistan on Monday.   -  AP

Pakistan fell agonisingly short of an historic first-Test victory as Australia survived an almighty scare to triumph by just 39 runs on the fifth and final day in Brisbane.

> Scorecard and ball-by-ball details

Chasing a mammoth and world record fourth-innings target of 490 at the Gabba on Monday, Pakistan's stubborn rear-guard was finally broken as Steve Smith produced an incredible direct hit to run out Yasir Shah (33) and dismiss the spirited touring team for 450.

Centurion and man-of-the-match Asad Shafiq (137) was impenetrable until he departed four deliveries earlier and once he returned to the pavilion to a standing ovation, there was only ever going to be one victor in the first of three Tests.

The odds were firmly stacked against Pakistan, which resumed on 382-8, however the Australians appeared visibly frustrated as the Pakistanis produced an admirable performance, Shafiq leading the way as the impossible became the seemingly possible with every passing ball and run.

Mitchell Starc (4-119), Josh Hazlewood (0-99), Jackson Bird (3-110) and Nathan Lyon (2-108) toiled tirelessly without reward, with Shafiq and Yasir Shah continuing to find the gaps in the field as the total slowly went from 100 runs to 50.

Whatever the Aussies threw at Shafiq and Shah, the stubborn duo responded, combining for an inspirational 71-run ninth-wicket stand before the former fell victim to the pace and bounce of Starc.

A short delivery pitched outside off stump saw Shafiq come unstuck as the star Pakistani skied a ball into the air and straight to David Warner at gully in the 145th over.

That is all the Australians needed, with Smith — who dropped two catches on Sunday — reacting quick to hit the stumps from slips after Yasir strayed away from his crease in a lackadaisical end to the game as the series moves to Melbourne for the Boxing Day Test.