Jennifer Hermoso scored on two second-half penalty kicks Saturday as Spain came from behind to beat Women's World Cup debutants South Africa 3-1 in Group B.

Spain failed to win a single game in its first appearance at a World Cup in 2015 but entered this tournament as one of the favourites thanks to an impressive qualification campaign in which Hermoso starred with seven goals.

But Jorge Vilda's side looked to be heading toward a shocking defeat thanks to Thembi Kgatlana's 25th-minute strike in Le Havre, only for Janine van Wyk's handball to hand Spain a reprieve – Hermoso taking full advantage from the spot.

The turnaround was completed in the 73rd minute when VAR was used to punish Nothando Vilakazi – who received a second yellow card – for a lunge on substitute Lucia Garcia, with Hermoso keeping her composure to secure a hard-fought win before Garcia added an insurance goal later in the match.

Spain was the only team to maintain a 100% winning record through qualifying and was quick to show its strength Saturday, though South Africa's confidence soon grew.

And, after Vilakazi saw her goal-bound set-piece deflected wide, South Africa went ahead when Kgatlana looped a delicate finish over Sandra Panos, who should have done better.

Hermoso tried her luck with a hooked effort shortly after the restart, but Andile Dlamini made a brilliant save onto the crossbar at full stretch, before Kgatlana sent a tame effort at Panos at the other end.

That miss proved costly in the 70th minute when Hermoso tucked one home from 12 yards after her strike hit the upraised arm of Van Wyk.

Virginia Torrecilla had a goal disallowed for offside as Spain stepped up the pressure, and it made its mark when Vilakazi recklessly dived in on Garcia, with Hermoso stepping up to complete the comeback.

Spain was not done, though, as Garcia capped her impressive cameo with a composed finish to move the team to the top of Group B.