Cardiff - Pakistan captain Sarfraz Ahmed Monday led from the front to take his team to ICC Champions Trophy semifinals after carving out a sensational three-wicket win over Sri Lanka in last match of the group stage at the Sophia Gardens, Cardiff.

Pakistan's Sarfraz Ahmed and Mohammad Aamir put on a record eighth-wicket stand of 75 to take their team through to the semi-finals of the ICC Champions Trophy at the expense of Sri Lanka. Sarfraz was dropped twice in the closing stages from the bowling of Lasith Malinga, but rode his luck to finish unbeaten on 61 from 79 balls, having found a reliable partner in Aamir (28o from 43) as the Pakistanis reached their target of 237 with 31 balls and three wickets to spare.

Sri Lanka had looked almost certain to progress when Pakistan's middle-order fell to 7-162 following a blazing start from Fakhar Zaman (50 from 36), with the middle-order trio of Babar Azam (10), Mohammad Hafeez (1) and Shoaib Malik (11) all failing to make an impact on proceedings. And when Imad Wasim was out for four and debutant Fahim Ashraf (15) was run-out after being slow to react at the non-striker's end, Pakistan looked like producing one of their famous implosions.

But Sarfraz and Aamir's rescue act turned the tide in a thrilling contest, the pair picking singles amid some hazardous running and finding the rope at crucial intervals to see their team home.  Pakistan began the run chase favourites after earlier restricting Sri Lanka to 236 all out.  Opening batsman Niroshan Dickwella made a fine 73 as Sri Lanka's innings showed early promise, but the Pakistanis came roaring back into the contest thanks to some fine bowling from Hasan Ali (3-42), Junaid Khan (3-40) and Mohammad Aamir (2-53).

Sarfraz won the toss and Junaid got the early breakthrough, removing Danushka Gunathilaka for 13, before Kusal Mendis (27) and Dinesh Chandimal (0) fell in quick succession.  Dickwella, who had earlier signalled his attacking intentions with a stunning scoop shot for four, teamed up with captain Angelo Mathews (39) and for a while it looked as if the Sri Lankans were on track for a sizeable total.

At 3-161 in the 32nd over, Aamir knocked over Mathews to claim his first wicket of the tournament and trigger a dramatic collapse of four wickets for just six runs. Aamir took a second while Junaid took two more as the pace pair followed Hasan's lead, extracting movement from the pitch and through the air in an impressive display of fast bowling.

Asela Gunaratne (27) and Suranga Lakmal (26) put on 46 for the eighth wicket to help Sri Lanka post what was in the end a moderate total, but the island nation will need an outstanding bowling effort if they're to progress through to the semi-finals. Sri Lanka batsman Dhananjaya de Silva was included after batsmen Chamara Kapugedera and Kusal Perera were both ruled out for the remainder of the tournament, while teenage leg-spinner Shadab Khan was left out of the Pakistan XI, with debutant quick Fahim Ashraf (2-37) included in his place.

Both Pakistan and Sri Lanka were less fancied, but they have both caused upsets with Sri Lanka stopping the Indian juggernaut and doled out a shock defeat and Pakistan stunning world No 1 ODI team South Africa.

Scoreboard

SRI LANKA:

N Dickwella c Sarfraz b M Amir 73

D Gunathilaka c Malik b Junaid Khan 13

K Mendis b Hasan Ali 27

D Chandimal b Fahim Ashraf 0

A Mathews b M Amir 39

D de Silva c Sarfraz b Junaid Khan 1

A Gunaratne c Fakhar b Hasan Ali 27

T Perera c Babar b Junaid Khan 1

S Lakmal b Hasan Ali 26

L Malinga not out 9

N Pradeep c & b Fahim Ashraf 1

EXTRAS: (b 1, lb 5, w 12, nb 1) 19

TOTAL: (all out; 49.2 overs) 236

FOW: 1-26, 2-82, 3-83, 4-161, 5-162, 6-162, 7-167, 8-213, 9-232, 10-236.

BOWLING: M Amir 10-0-53-2, Junaid Khan 10-3-40-3, Imad Wasim 8-1-33-0, Fahim Ashraf 6.2-0-37-2, Hasan Ali 10-0-43-3, M Hafeez 5-0-24-0.

PAKISTAN:

Azhar Ali c Mendis b Lakmal 34

Fakhar Zaman c Gunaratne b Pradeep 50

Babar Azam c de Silva b Pradeep 10

M Hafeez c Pradeep b Perera 1

Shoaib Malik c Dickwella b Malinga 11

Sarfraz Ahmed not out 61

Imad Wasim c Dickwella b Pradeep 4

Fahim Ashraf run out 15

M Aamir not out 28

EXTRAS: (b 4, lb 6, w 13) 23

TOTAL: (7 wickets; 44.5 overs) 237

FOW: 1-74, 2-92, 3-95, 4-110, 5-131, 6-137, 7-162.

BOWLING: SL Malinga 9.5-2-52-1, RAS Lakmal 10-0-48-1, N Pradeep 10-0-60-3, NLTC Perera 8-0-43-1, DAS Gunaratne 5-0-19-0, MD Gunathilaka 1-0-2-0, DM de Silva 1-0-3-0.

TOSS: Pakistan

UMPIRES: M Erasmus (South Africa) and BNJ Oxenford (Australia)

TV UMPIRE: CB Gaffaney (New Zealand)

MATCH REFEREE: DC Boon (Australia)

RESERVE UMPIRE: IJ Gould