France, Switzerland, Nigeria and Argentina all made it through to the World Cup last 16 after the penultimate night of group matches on Wednesday.
France will face Nigeria in the last 16, but made hard work of it against an Ecuador side reduced to ten men in the 48th minute when their captain Antonio Valencia was sent off.
The Manchester United winger saw red for a challenge that injured France's left-back Lucas Digne, and although Valencia had won the ball, referee Noumendieze Doue of the Ivory Coast produced a red card.
It was tough on Ecuador, who needed to get a better result than Switzerland to have any chance of going through, and with the Swiss beating Honduras easily, even a 1-0 victory would not have been enough.
Xherdan Shaqiri scored a hat-trick to ensure Switzerland reached the last 16 of the World Cup and they will now play Argentina in the knock-out stages.
Shaqiri stole all the headlines in Manaus and helped his side set up a mouth-watering tie against Lionel Messi and the other Argentine players.
It was a tournament that Honduras will want to forget after suffering three defeats and finishing bottom of Group E.
Iran suffered heartache as they failed to reach the last 16 following a 3-1 defeat against already-eliminated Bosnia-Herzegovina.
Carlos Queiroz had defied the odds to give his Iran side a chance of reaching the knock-out stages if they had managed to gain a victory.
But those hopes disappeared after goals from Edin Dzeko and Miralem Pjanic put Bosnia in pole position to win the game.
Reza Ghoochannejad pulled a goal back for Iran but it proved to be a consolation as Avdija Vrsajevic sealed the victory which gave Bosnia their first World Cup Finals win.
In Porto Alegre, Messi netted a superb brace to help Argentina beat Nigeria by 3-2 in a five goal thriller to finish top of Group F.
Nigeria also qualified for the knock-out stages after Iran failed to beat Bosnia-Herzegovina in the other group game.
And when Messi put Argentina into the lead, Nigeria refused to lie down and grabbed an equaliser just 80 seconds later through Ahmed Musa.
Even though Messi restored Argentina’s lead on the stroke of half time, Nigeria would draw level again just a minute into the second half through Musa.
But it was left to Marcos Rojo, who scored the winning goal for Argentina on 50 minutes. Nigeria failed to clear a corner and Ezequiel Garay’s header hit Rojo on the knee and the ball flew into the net.