MOSCOW (AP) – Two of the best teams in international soccer this week went into their final group matches in danger of being bounced from the World Cup.

Germany and Brazil, both early favorites for the title, struggled through their opening two matches. The teams have a combined nine World Cup titles, Germany is the defending champion and Brazil is still trying to redeem itself from a humiliating 7-1 loss in the 2014 semifinals, in which it was the host nation.

Germany was shocked in its opening match in Russia by losing to Mexico, and the squad needed a goal in stoppage time from Toni Kross to pull out a 2-1 victory over Sweden. To avoid elimination in the first round of the World Cup for the first time since 1938, Germany needed a strong showing on Wednesday against South Korea in a wide-open Group F finale at Kazan Arena.

Germany coach Joachim Loew has been blasted at home for conservative roster choices. So Loew made four changes against Sweden, including dropping playmaker Mesut Ozil from the starting lineup. The changes made for a balanced team that was relieved to pull out the win against Sweden.

South Korea’s chances to advance are slim, and captain Ki Sung-yueng won’t play because of a left calf injury. If South Korea beats the four-time world champions, and Sweden loses to Mexico, the squad could make it to the round of 16.

Brazil, meanwhile, is trying to regain some swagger. The five-time champions head into their final group match against Serbia at Spartak Stadium in Moscow needing only a draw to advance.

But after a 1-1 draw against Switzerland, Brazil needed two injury-time goals to pull out a 2-0 victory over Costa Rica. Neymar has been frustrated with the play of the national team, and he dropped to his knees and sobbed after the Costa Rica match.

Serbia understands that it needs spectacular play to continue its tournament.

“Yes, we definitely need a miracle. That is what can make us beat Brazil and get through to the next stage,” Serbia midfielder Sergej Milinkovic-Savic said. “I always say that those that believe in miracles can make them happen. We are Serbian, nothing is impossible. With a bit of luck, we can produce a miracle.”

More from Around NYC