Pakistan slumped to their third straight defeat at the Women's Cricket World Cup against South Africa on Friday, leaving their hopes of making the playoffs under a cloud.
Pakistan came agonisingly close to victory after going into the fixture ranked last in the eight-team tournament's standings after heavy losses to India and Australia.
They lost two wickets in the final over, finishing on 217 all out chasing a target of 224.
South Africa captain Sune Luus said it was a nerve-shredding encounter for her team, who beat Bangladesh in their opening match.
"You've got to love a World Cup game, no game's easy," she said.
"I'm just happy with the team's performance, even though we're not playing our best cricket yet."
Luus said before the match she wanted her batters to show more intensity than they displayed in their victory over Bangladesh, when they were restricted to 207 runs.
Opener Laura Wolvaardt stuck to the script, hitting an aggressive 75, but the rest of the top order struggled against Pakistan's spinners.
The middle order offered more resistance, with Luus contributing 62 and Chloe Tryon and Trisha Chetty adding 31 apiece.
Spinner Ghulam Fatima and all-rounder Fatima Sana were Pakistan's most effective bowlers, each taking three wickets.
The pressure exerted by the bowling attack was undermined by four dropped catches, but South Africa's total of 223-9 looked far from imposing.
Pakistan made a sluggish start to the run chase after Shabnim Ismail took two wickets in successive balls, but Nahida Khan and Omaima Sohail came together for a crucial 69-run partnership.
Khan departed for 40 and Sohail held on for 65 but neither could bat through to the end.
With Pakistan needing just over a run per ball from the final 10 overs, it fell to Nida Dar to try to guide the tailers to victory.
She made a fine effort, making 55 before being run out with Pakistan needing 11 runs from seven balls and her team falling just short of the target.
Brief scores
Brief scores from day eight of the Women's Cricket World Cup after South Africa beat Pakistan by six runs in Mount Maunganui on Friday:
South Africa 223-9 in 50 overs (L. Wolvaardt 75, S. Luus 62; F. Sana 3-43, G. Fatima 3-52)
Pakistan 217 all out in 49.5 overs (Omaima Sohail 65, Nida Dar 55, Omaima Sohail 40; Shabnim Ismail 3-41)