David Warner dazzled with the bat before Australia rode their luck in a gripping match to beat Pakistan at Taunton.

The opener made a fine 107 from 111 balls to help Australia lay the platform for a 41-run victory, which meant a sparkling 5-30 performance from Pakistan paceman Mohammad Amir went unrewarded.

Warner's dismissal came in the early stages of an Australian collapse, as they slumped from 189-1 to 307 all out, and Pakistan also displayed a self-destructive streak in the Somerset gloom.

A middle-order collapse saw Pakistan 160-6, but their tail showed plenty of gumption. They had Australia worried until Mitchell Starc took two wickets in three balls and Glenn Maxwell ran out Sarfraz Ahmed to kill the contest, Pakistan all out for 266.

Australia captain Aaron Finch was dropped on 26 by Asif Ali off Wahab Riaz, and by going on to reach 82 he made Pakistan pay. Finch was eventually caught off Amir, aiming to hoist over midwicket but instead thrashing the ball high into the off side, with Mohammad Hafeez taking the catch.

Steve Smith and Maxwell went cheaply before Warner perished, mistiming an intended blow straight down the ground to be caught by Imam-ul-Haq, dashing in from the boundary to deep point.

Australia were still well placed at 242-4 in the 38th over, but a combination of rash lower-order batting and the admirable guile of Amir meant the innings ended with a whimper.

Pakistan lost Fakhar Zaman to a third-ball duck, slashing at Pat Cummins and caught at third man by Kane Richardson.

They rebuilt well, with Imam sharing in partnerships of 54 for the second wicket with Babar Azam and then 80 for the third wicket with Hafeez.

A clatter of four wickets in five overs had Pakistan flailing at 160-6, Cummins taking 3-33 in his 10 overs, and at that point it was hard to see past a crushing Australia win.

Yet Hasan Ali thrashed three sixes in a 15-ball 32 that showed Pakistan were not finished, and Wahab Riaz plundered 45 before a DRS review showed he feathered Starc through to Alex Carey.

Starc bowled Amir before Maxwell finished off the job, and Australia, rattled just minutes earlier, could enjoy the victory moment.

What does it mean? 

If this is all these two teams have, only the most optimistic supporter would predict they will win this tournament. Australia folded as a batting unit after Finch and Warner showed how the Pakistan attack could be unpicked, and with the ball they looked to be lacking ideas in the closing stages. Pakistan came rattling back into a match that looked lost, as they gorged on bowling ripe to be attacked. It made for an entertaining spectacle but both sides left room for improvement.

This is not a vintage Australia team

Bowling is a problem for Australia and captain Aaron Finch admitted in a post-match interview his attack needed to back themselves more in the closing stages. This was a match that almost swung out of Australia's grasp and into the hands of Pakistan, and even if Australia reach the semi-finals, as they well may, there look to be stronger sides in this World Cup.