Pakistan beat South Africa by 19 runs on the DLS method to cause a Champions Trophy upset in the Edgbaston rain.

Pakistan, hammered by India on Sunday, reduced the world number ones to 90-4 and 118-6 before David Miller's 75 not out helped them to 219-8.

Although Morne Morkel took 3-18, Pakistan were 119-3 when the forecast bad weather arrived after 27 overs.

The win reignites Pakistan's semi-final hopes, while South Africa may have to beat India to stay in the tournament.

The result opens up Group B, which also contains Sri Lanka. They meet India on Thursday and, regardless of the result, all four teams will still be able to qualify for the semi-finals in the final round of fixtures.

The runners-up in this group face England in the first semi-final in Cardiff on Wednesday.

Pakistan provide the spark

Media playback is not supported on this device

De Villiers out for a golden duck

Prior to Wednesday's game at Edgbaston, the Champions Trophy had been a mix of no-results and no-contests. The closest of the four previous completed games was England's 87-run win against New Zealand.

Until the rain, this was gripping and entertaining, thanks mainly to a Pakistan side transformed from the one that rolled over against India.

Their bowling went from ineffective to accurate and hostile, their fielding from sloppy to tigerish and their batting from spineless to dogged - all in front of a partisan Birmingham crowd.

South Africa played their part, mainly through the brilliant Morkel. Tension was created by the threat of rain, with Pakistan only gaining a comfortable cushion on the DLS par score just before the players went off.

Hasan leads Pakistan charge

Media playback is not supported on this device

South Africa's top four stunned by Pakistan bowling attack

Choosing to bat first on a pitch already used twice, South Africa faced spin after only eight overs and were squeezed by Imad Wasim and Mohammad Hafeez, including a first one-day international golden duck for captain AB de Villiers.

They were steadied by Miller and JP Duminy before paceman Hasan Ali, who had already bowled Faf du Plessis, struck twice in two balls. First a flat-footed Duminy was held at slip, then Wayne Parnell was bowled by a beauty.

Chris Morris joined Miller to repel yorker after yorker, Miller successfully overturning an lbw decision on 47 to register an 83-ball half-century, his slowest in ODIs.

Morris made 28 and Kagiso Rabada 26 - both holed out to Hasan off Junaid Khan, the latter to a brilliant catch - before Miller, who clubbed three sixes, hit the last delivery of the innings for the only four of his 104-ball stay.

Pakistan edge ahead despite Morkel barrage

Media playback is not supported on this device

Four off last ball before rain stops play

As South Africa bowled with too much width, debutant opener Fakhar Zaman helped himself to 31 from 23 balls before Morkel intervened.

Morkel aggressively banged away back of a length and was supported by Morris and Imran Tahir, almost entirely halting Pakistan's scoring.

Only 20 runs were added in 10 overs but, crucially, Babar Azam and Hafeez survived to ensure the DLS par score remained within reach. When they took 10 from Morris in the 19th over, Pakistan were ahead.

Now Pakistan were scoring more freely and, even though Morkel returned to have Hafeez well held by Tahir at fine leg, South Africa were behind when the rain came.

'You can never write Pakistan off' - what they said

Former England spinner Graeme Swann on TMS: "We thought this was going to be one-sided because of the way Pakistan played against India. However, you can never really write Pakistan off because of their mercurial nature. They are number one in the world at surprising people."

Man of the match Hasan Ali: "It was a team effort. I stuck to my plan and we all stuck to our plan. I dropped a catch in the last game, so I knew I had to cover that. I did it nicely.

"It's very important to win man of the match because it's my first ICC event. I'm very excited."

Pakistan captain Sarfraz Ahmed: "That is a feeling we miss, not playing in Pakistan. Maybe that was a difference - the crowd was supporting us and that's why the players boosted up."

South Africa coach Russell Domingo: "Pakistan are a proud cricketing nation. I know when they have a bad game, everybody jumps on their back and says how bad they are.

"I can tell you now, in our position, I don't think they are bad at all. They are a dangerous side. They have some world-class players. They are always going to be a threat."