Niclas Fuellkrug's late equaliser snatched Germany a morale-boosting 1-1 draw with Spain in a heavyweight World Cup clash on Sunday, leaving both sides' hopes of qualifying for the last 16 still in the balance.
Alvaro Morata's flicked finish had Spain on course to secure qualification from Group E, but the electric Jamal Musiala and Fuellkrug combined to foil La Roja and restore some German pride.
Costa Rica's surprise win over Japan earlier eased some pressure on Germany after their shock loss to the Asian side, but they were unable to capitalise for large periods in a battle for the ball against Spain.
The four-time world champions suffered a humiliating group-stage exit in Russia four years ago, and Morata's strike at Al Bayt Stadium had them on the ropes, but Werder Bremen striker Fuellkrug finished brilliantly to divide the points.
Spain lead Group E on four points, from Japan and Costa Rica on three each, while Germany have one, with a final round of matches to come.
"We really wanted to pull (this game) back, that was very important for the feelings (in the camp)," Fuellkrug told German TV network ZDF.
"We still have room for improvement, but we can hope that everything turns out well in the final game."
The only World Cup group-stage clash to pit two former champions against each other lived up to its top billing in intensity and tactical intrigue, with both sides set on trying to dominate possession and press extremely high.
Germany coach Hansi Flick rejected suggestions his side had been distracted in their shock opening defeat by Japan because of their pre-game protest against FIFA "silencing teams" and the taut opening exchanges quickly ensured all focus was on the football.
Flick cut Kai Havertz from his line-up and deployed Thomas Mueller up front after their shocking opening-day capitulation, hoping for a quick reaction.
However, Spain almost took the lead in the seventh minute when Manuel Neuer palmed Dani Olmo's powerful drive from range onto the woodwork.
It seemed like they were picking up where they left off after their 7-0 demolition of Costa Rica, but Germany steeled themselves, keeping Luis Enrique's side at bay.
- Clinical Morata -
Spain goalkeeper Unai Simon relied on his footwork under pressure as La Roja sought to dominate possession.
One mistake handed Serge Gnabry an opportunity, but he fired wide.
Neuer erred with the ball at his feet too, with Germany similarly looking to build from the back, but Ferran Torres could not capitalise.
Antonio Ruediger powered home a header from a free-kick, but his celebration was cut short after VAR caught him half a step ahead of the Spanish defence, while Simon made a fine save to foil Joshua Kimmich.
Just when Luis Enrique's side seemed to have lost their grip on the game, they broke the deadlock.
Morata, on for Torres, finished clinically at the near post from an inviting low cross from Jordi Alba after 62 minutes.
It looked like it was enough for the 2010 champions, but Fuellkrug -- on only his third international appearance -- decided otherwise, sneaking in behind substitute Alejandro Balde and lashing past Simon with seven minutes remaining.
Spain, who need a point to be certain of progressing, face Japan on Thursday, while Germany need to beat Costa Rica and hope La Roja do not lose.
"They are a great team, they had one big chance and they took it," Morata told Spain's TVE.
"They man-marked our best players and they are a team that could be among the favourites to win the World Cup, so we have to take the positives and keep working."