Hanover, Germany (My Sportsbook) - Patrick Vieira scored the go-ahead goal in the 83rd minute to lift France over Spain, 3-1, in the final Round of 16 match in Hanover.
Frank Ribery and Zinedine Zidane also found the back of the net for France, which will now play Brazil in the quarterfinals on July 1.
David Villa scored the sole goal for Spain, which will go home despite winning all three of its matches in group play.
Spain led France in ball possession and shots on net, but it wasn't enough as it had an overall 25-match unbeaten streak come to an end.
Villa opened up the scoring in the 28th minute for Spain via a penalty kick. Pablo Ibanez was taken down in the box by France's Lilian Thuram to set up the kick from the spot. Goalkeeper Fabien Barthez guessed right on Villa's kick, but it still wasn't enough as the Spanish forward buried it down low in the left corner. Spain has never missed a penalty kick during regulation play in the World Cup, and converted its second shot from the spot in the 2006 tournament.
However, before the first half ended, Frank Ribery notched his first National team goal for France to make it a 1-1 affair at the intermission. In the 41st minute, Ribery received a pass at the top of the penalty area, dribbled around Spanish goalkeeper Iker Casillas and fired into an empty net from eight yards out.
Vieira's crucial goal came courtesy of a header at the back post. The play was set up by a Zidane free-kick, which was touched through traffic before finding Vieira's head. Spanish defender Sergio Ramos got a touch on the ball while trying to kick it away at the goal line, but Vieira was given credit for the goal.
Zidane, who will be retiring from the international game after this tournament, sealed the victory in added time with a hard shot down low from inside the penalty area.
France continued its success in meaningful matches versus Spain. It was the sixth all-time competitive encounter between the two teams, with France winning five and drawing once against its European rival.