Manuela Vanegas scored in the seventh minute of stoppage time as Colombia upset Germany 2-1 at the Women’s World Cup on Sunday.

The defender headed in to settle a thrilling game and put her country on the brink of advancing to the knockout stage.

Alexandra Popp had scored an 89th-minute penalty and seemed to have earned two-time champion Germany a 1-1 draw after 18-year-old Linda Caicedo had struck a stunning opener for Colombia.

But Vanegas came up with a late twist to huge celebrations from Colombia fans who dominated the Sydney Football Stadium crowd.

The Germans thought they’d secured a point after Colombia goalkeeper Catalina Perez was penalized for bringing down Lena Oberdorf in the box.

Popp, who scored twice in her country’s 6-0 rout of Morocco in its opening game of the tournament, fired straight down the middle to level the game.

That had disappointed the crowd, which passionately cheered Colombia on throughout and erupted after Caicedo’s goal in the 52nd.

The Real Madrid teenager had suffered a health scare earlier in the week but produced a moment of magic to score her second of the tournament.

It was all the more special coming after she’d dropped to the ground holding her chest in training during the week.

Caicedo scored from distance in the 2-0 win against South Korea on Tuesday. But while that goal involved an error from goalkeeper Yoon Young-geul, on this occasion it was all about individual brilliance.

Collecting the ball from just inside the area after a corner, she worked her way into space by bewildering two German defenders in a fast-stepping move before lashing a shot into the top corner.

Caicedo, followed by her teammates, charged toward the corner to get closer to the crowd as it went wild.

Germany has never failed to advance from the group stage of the World Cup. It is still expected to beat South Korea in its last game of Group H, but will likely have to settle for second place.

The runners up at last year’s Euros should have been ahead in the first half when Popp was guilty of missing the target with a volley from close range —shortly before the break.

Earlier Lina Magull had the chance to test Perez from close range, but mis-kicked and the opportunity was wasted.

What’s next

In the last games in Group H, Germany faces South Korea and Colombia plays Morocco, with three teams still able to advance to the knockout stage.