Postpublished at 18:45 British Summer Time 12 June 2017
I'll leave you with this, the winning moment from the best game of the competition. Bye for now.
Pakistan face England in semi-final in Cardiff on Wednesday
Sarfraz & Amir share tournament record 8th wicket partnership of 75
Pakistan had fallen from 92-1 to 162-7
Sri Lanka made 236 after stumbling from 161-3 to 167-7
Junaid 3-40, Hasan 3-43, Ashraf 2-37
Extended highlights on BBC Two at 23:15 BST (23:45 in Wales)
Stephan Shemilt
I'll leave you with this, the winning moment from the best game of the competition. Bye for now.
So we know the semi-final line-up. England will take on Pakistan on Wednesday, followed by India-Bangladesh on Thursday. All set for an England v India final, or will this tournament throw up another surprise?
Simon Hughes
BBC Test Match Special commentator
Sarfraz Ahmed played so skillfully. There's a hint of Javed Miandad about him - he's combative, pugnacious and always up for the challenge. Today was a match-up between two hard-nosed captains and Sarfraz emerged the victor.
Pakistan captain Sarfraz Ahmed: "All credit to the bowlers, they played very well - Junaid and Amir. I'm very impressed with Fakhar, he is a good prospect for Pakistan."
Sri Lanka captain Angelo Mathews: "It was a see-saw game. Pakistan held their nerve, so credit goes to them. They deserve it.
"It was a funny wicket, the ball was stopping. We knew we hadn't got the runs but that we could bowl well. Our bowlers were brilliant. Unfortunately we dropped catches and that cost us the game.
"I'm very proud of the boys. We gave it our all. It was quite a good tournament. We fought really hard."
Simon Hughes
BBC Test Match Special commentator
Pakistan's bowling attack made this possible. Sri Lanka were primed for a big score and the turning point in the innings was when Angelo Mathews was clean bowled by Mohammad Amir. Sri Lanka never really had enough and although they bowled well, their fielding was flawed and they didn't deserve to win.
Man of the match Sarfraz Ahmed: "I said to Amir to play your game, to not worry. If he scored 20 runs, which he did, we would win.
"It was very tough. Amir played confidently and I felt pressure. Thanks to him, he played very well."
#bbccricket
Ben Dunbar: You have to feel for Malinga, his last spell in serious international one-day cricket and it's spoiled by inept fielding
And now we know who England will play in the semis. Pakistan will be back on the same ground in less than 48 hours. After this, are they dangerous, or just a tiny bump in England's road?
An embrace for Amir, then a kiss of the Welsh turf. Sarfraz and Amir added 75 for the eighth wicket - a Champions Trophy record.
Pak 237-7
All over! Pakistan are into the semi-finals! Sealed with a guide to the third-man boundary, then Sarfraz is off on a victory lap. Cardiff erupts. A wonderful, wonderful game of cricket, the best of the tournament so far.
Dan Norcross
BBC Test Match Special
A three is far too much running for Sarfraz.
And two more! Sarfraz is blowing. He'll need oxygen at the end of this.
Two more, worked behind square by Sarfraz. We could be done in this over.
One more. Amir behind point. Pakistan coach Micky Arthur rocks back and forwards. He's being tortured.
Simon Hughes
BBC Test Match Special commentator
The wheels have fallen off for Sri Lanka - they even look sloppy when the fielders return the ball to the keeper.
Wide! A bouncer too high. Single figures...
Malinga back. Sarfraz takes a single to square leg. 10 required.
Need 11 from 36 balls
Mathews is trying everything. Gunaratne back to bowl his odd off-cutters. He has the habit of pulling his trousers up before he delivers each balls. Short single! Sarfraz dives to make his ground. Shot! Mohammad Amir comes over all David Gower and belts through the covers for four. Just two blows needed by Pakistan.
Need 17 from 42 balls
Dhananjaya de Silva. Thrown into the tournament, now thrown the ball. "Get me a wicket". The carrot is dangled but Amir is wise to the game. Three singles from it. That's plenty for Pakistan. They are almost home and hosed.