A first-half strike from Jese coupled with Paco Alcacer’s second-half effort gave La Roja the win, with France claiming a 91st-minute consolation through substitute Thibaut Vion.
Olarenwaju Kayode's goal was enough to see Nigeria beat Korea Republic 1-0 in Group B and secure a place in the last 16.
Ghana retain a slim chance of reaching the knock-out stages after a 4-1 victory over the USA.
Ebenezeer Assifuah got a brace after Frank Acheampong opened the scoring and before Kennedy Ashia put gloss on an already polished performance.
Shane O'Neill got a 69th minute consolation in what has been a disappointing tournament for the Americans.
The win leaves gives Ghana hope of qualifying from Group A as one of the best third-place sides.
Bruma got a brace and claimed another couple of assists as Portugal secured top spot in Group B with a comfortable 5-0 win over Cuba in Kayseri.
Strikes from Aladje and Ricardito opened up a two goal lead inside 37 minutes before Bruma’s double – either side of half-time – ended the game as a contest.
Toze made it five with just over 20 minutes to go.