MUNICH (AP) — Germany finally clicked into gear at the European Championship, with a little help from defending champion Portugal.

The Portuguese became the first team to score two own-goals in one game at the continental tournament, giving the Germans a 4-2 victory on Saturday and ending fears of another group-stage exit.

“Altogether it was a class performance. Great attitude, great morale. We deserved to win by this amount,” said Germany coach Joachim Löw, whose team lost its opening game to France. “I expected that we would do the things that we didn’t do so well against France better.”

Cristiano Ronaldo put Portugal in the lead in the 15th minute against the run of play. It was his first goal against Germany and his third at Euro 2020. It also extended his all-time tournament record to 12 goals.

But defenders Rúben Dias and Raphaël Guerreiro gave Germany the lead before halftime by scoring into their own net.

Kai Havertz and Robin Gosens then got two more for Germany early in the second half — becoming the first players within the squad to score at a European Championship.

Advertising

“It’s magic,” said Gosens, who was playing in his ninth game for Germany.

Diogo Jota got one back for Portugal in the 67th after Ronaldo acrobatically saved a free kick from going out.

The German supporters sang “Oh wie ist das schön” (Oh how lovely this is) as they watched their team dominate the game from start to finish — something they hadn’t seen in years of underachievement.

“When you have such good attacking scenes, the kettle boils,” said Thomas Müller, who has yet to score in 13 games at the tournament. “Now we have the three points that we absolutely needed. We shouldn’t get carried away. You can feel a little bit of euphoria, but we also have to remain objective.”

The 2014 World Cup champions had been looking for a good showing at Euro 2020 to make up for their first-round exit at the 2018 World Cup in Russia.

Both Portugal and Germany now have three points in Group F, one behind current World Cup champion France, which was surprisingly held to a 1-1 draw by Hungary in Budapest.

Advertising

Hungary has one point and will next play Germany on Wednesday in Munich. France will play Portugal in Budapest.

“It was important for us that we didn’t throw everything overboard after the lost game against France, but stuck to our plan,” Havertz said. “We trust the coach, we trust the system.”

Germany had the ball in the net early against Portugal when Gosens volleyed in a cross from Joshua Kimmich, but the goal was ruled out on video review for one of a number of possible infringements. Serge Gnabry was offside and Thomas Müller handled the ball.

Ronaldo was the first to strike for real — after a German corner.

Bernardo Silva sent a ball over Havertz for Jota, who took the ball on his chest and crossed for Ronaldo’s easy tap in.

Clearly shaken, a more cautious Germany resumed where it left off, albeit a little more carefully than before.

Advertising

Havertz forced the equalizer in the 35th minute when he went for Gosens’ cross alongside Dias, who deflected it inside the far post.

Germany then took the lead through another own-goal soon after. Havertz failed to connect with a cross from Müller but Kimmich sent the ball back in and it rebounded into the net off the unfortunate Guerreiro.

Havertz finally got his goal early in the second half when Gosens set him up for an easy finish. Gosens then headed in the fourth at the back post from Kimmich’s cross.

“It’s my responsibility. I wanted to play like that,” Portugal coach Fernando Santos said. ”We were on top in midfield, but the Germans managed to break free from difficult situations again and again. By and large, my players tried everything. But playing against Germany is just difficult.”

___

This story has been corrected to show that Gosens set up Havertz for a goal, not Müller.

___

More AP soccer: https://apnews.com/hub/soccer and https://twitter.com/AP_Sports

___

Ciarán Fahey on Twitter: https://twitter.com/cfaheyAP