Robert Lewandowski rescued Poland with a second-half equaliser and Gerard Moreno missed a penalty as Spain were held to a 1-1 Euro 2020 draw at La Cartuja Stadium.
Álvaro Morata silenced his critics by opening the scoring in the Group E encounter in Seville on Saturday after coming under fire for his performance in a stalemate against Sweden.
A defeat would have ended Poland's hopes of qualifying for the round of 16, but their record goalscorer and captain Lewandowski equalised with a header nine minutes into the second half.
Moreno failed to put Luis Enrique's side back in front from the spot just after Lewandowski's leveller, leaving Spain and Poland third and fourth in the group respectively with one game to play.
La Roja were in front 25 minutes in, Morata turning in Moreno's tame shot from close range with his right foot and belatedly running away to embrace coach Luis Enrique after the VAR ruled he was onside.
Moreno, starting at the expense of Ferran Torres, curled a free-kick narrowly wide before Karol Swiderski volleyed a glorious chance to equalise off target from point-blank range.
Swiderski rattled the post with a thunderous left-foot drive and Lewandowski was denied by Unai Simon following up, with Moreno firing into the side-netting late in an entertaining first half.
Poland were level nine minutes into the second half, the prolific Lewandowski rising above Aymeric Laporte to brilliantly head home Kamil Jozwiak's inviting cross.
Lewandowski had barely finished celebrating when referee Daniele Orsato pointed to the spot after taking another look at Jakub Moder's tackle on Morata.
Moreno was unable to restore Spain's advantage, striking the post, and Morata failed to spare his blushes when he put the rebound wide with the goal gaping.
History was made when Poland substitute Kacper Kozlowski became the youngest player to feature in a European Championship aged 17 and 246 days in a tense encounter which remained in the balance.
Wojciech Szczesny spread himself magnificently seven minutes from time to thwart Morata as Spain endured a frustrating evening and Poland stayed alive.