Substitute Lucia Garcia made the difference as Spain laboured to a 3-1 win over South Africa in their opening game of the Women's World Cup in Le Havre.
Spain had looked woeful for long periods and fell behind to a 25th-minute strike from Thembi Kgatlana before Garcia's influence turned the tie around.
The underdogs had looked unfazed by the big occasion and made Spain pay for a series of missed chances when Kgatlana fired home a superb opening goal from more than 20 yards.
Kgatlana missed a glorious chance to increase her side's lead early in the second half and South Africa were punished when Jennifer Hermoso equalised from the penalty spot after 70 minutes.
Spain edged ahead seven minutes from time through another Hermoso spot-kick after a foul on Garcia by Nothando Vilakazi, who was sent off for a second bookable offence.
And the favourites made sure they would wrap up the points despite an unconvincing performance when Garcia tucked home her side's third with one minute remaining.
Scorers for Spain: Jennifer Hermoso 70' (Penalty); 83' (Penalty), Lucia Garcia 89';
Scorers for South Africa: Thembi Kgatlana 25';
Red card: South Africa; Nothando Vilakazi 82'
13 S.Panos, 8 M.Torrejon, 4 I.Paredes, 16. M.P.Leon, 7 M.Corredera, 11 A.Putellas, 14 V. Torrecilla, 6 V.Losada, 19, A.Sampedro, 10 Jenni, 9, M. Caldentey
16, A. Dlamaini, 11 T Kgatlana, 8 O.Fulutudilu, 10 L. Mothalo, 15 R. Jane, 19 K.Biyana, 9 A. Mthandi, 3 N. Vilakazi, 4 N. Matlou, 5. J . van Wyk, 2 L. Ramalepe
-PA with additional reporting by Digital Desk Staff