Ann-Katrin Berger clinched the Olympic bronze medal for Germany with a last-gasp penalty save as Die Nationelf edged out Spain by a 1-0 scoreline on Friday.
Giulia Gwinn gave Germany the lead from the penalty spot but Alexia Putellas had a chance to send the game to extra time at the death, only to be denied by Berger.
In a very even first half, Spain failed to register a shot on target, though they had the better chances as they twice struck Berger's crossbar. Teresa Abelleira curled a free-kick against the woodwork before Aitana Bonmati rifled a powerful long-range effort off it just before the break.
Germany's attempts to play on the counterattack eventually paid off, with Cata Coll giving away a penalty when she rushed off her line, only to crash into Gwinn.
The winger stepped up to take the spot-kick that she won, sliding it into the bottom-right corner and sending the goalkeeper the wrong way.
Berger later pushed away Jenni Hermoso's tame close-range header, but Spain would get one last chance when Janina Minge tripped Lucia Garcia in the box with mere seconds remaining.
Putellas' penalty was at a comfortable height for Berger, who dived the right way and got two strong hands on the shot to ensure her team got the prize.
Data Debrief: Gwinn's winning touch
Gwinn was the biggest attacking threat for Germany in the bronze-medal match, having the most shots (two) and more touches in the box (five) than any of her team-mates.
It is the fourth Olympic bronze that Germany have won, and their first since a run of three straight between 2000 and 2008.
Meanwhile, Spain's torrid run against Germany goes on - they have never beaten Die Nationelf in their history, and their wait for a first women's football medal at the Olympic Games will continue for at least another four years.