Both the Spaniards and former runners-up China knew a point in Le Havre would take them through to the knockout phase from Group B, and so they transpired to play out a 0-0 stalemate.
Spain did threaten to take all three points late on, but China goalkeeper Peng Shimeng made key saves in the last 10 minutes, getting down low to keep out a Patri Guijarro strike and then reaching to tip over a Jennifer Hermoso effort.
Spain finish in second place with four points and are through to the knockout phase for the first time, while China are relegated to third on goal difference but are already sure to progress as one of the best third-place finishers.
Former winners Germany had no trouble dispensing with South Africa in Montpellier, as the Banyana Banyana go home from their first World Cup without a point.
Leupolz was left unmarked to head in the opening goal from six yards out in the 14th minute at the Stade de la Mosson, and Sara Daebritz -- who recently signed for Paris Saint-Germain -- fired in the second.
Lina Magull missed a glorious chance to increase Germany's advantage but they went 3-0 up with five minutes left in the first half.
Giulia Gwinn crossed and captain Alexandra Popp emphatically headed home.
Magull got the fourth goal from close range after the break, and South Africa then tried in vain to grab a consolation, with Janine van Wyk firing just over from long range and Thembi Kgatlana being denied by goalkeeper Almuth Schult after going clean through.
Germany finish on top of the group with the maximum nine points and with no goals conceded. They go into a last-16 tie on Saturday in Grenoble against an as yet unknown third-place finisher from another group.
Spain will play in Reims on June 24 against either the United States or Sweden, while China must wait to find out which group winner they will come up against.
Group A concludes later on Monday, with hosts France facing Nigeria in Rennes and Norway aiming to wrap up their place in the knockout phase as they meet South Korea in Reims.