Spain forward Dani Olmo said he hoped injured midfielder Pedri would quickly return for the Euro 2024 semi-finalists, saying "this is a story we are all writing together".
Olmo came on after just eight minutes following an early injury to Pedri, who collided with Toni Kroos in a tackle.
The 26-year-old proved to be the crucial player in the match for Spain. He scored a goal after 51 minutes, before putting in a perfect assist in the penultimate minute of extra time for a 2-1 win over hosts Germany in Stuttgart.
Germany had earlier equalised in the 89th minute, with Florian Wirtz hammering in a Joshua Kimmich knock-down to send the game into extra time.
With the match headed towards penalties, Olmo's chipped cross was headed into the goal by Mikel Merino in the 119th minute, snatching a stunning victory for Spain.
"It was unbelievable, I don't know how I did it. I'm very proud, it was very difficult. We simply went forward and it worked out," added Olmo.
The RB Leipzig forward, one of two Spain squad members to play in Germany, said he was "exhausted, but you can see we have a great team and we fought until the end".
"It's wonderful for the whole team, I hope Pedri is feeling better, he's an important player for us and this is a story we are all writing together."
Pedri was shown with a heavily strapped knee after the match and will be a doubt for Spain's semi-final tie.
Spain will meet either France or Portugal in Tuesday's semi-final in Munich as they continue their bid for a record-breaking fourth Euros title.