After struggling again, as they had against Bulgaria and France, to discover their true selves, Spain at last conjured a decisive show of strength to advance to the quarter-finals.
They left it late, agonisingly so for their anxious supporters, but their goal four minutes from the end, headed past Florin Prunea by the substitute Guillermo Amor, produced a result that was on balance deserved after subjecting the Romanian goal to intense second-half pressure.
It means that they and not Bulgaria go through as runners-up to France. Had they finished 1-1, Hristo Stoichkov and company would have progressed despite their defeat in Newcastle.
Jose Caminero, who scored the vital equaliser against France, was left out this time as coach Javier Clemente made four changes, bringing back Juan Antonio Pizzi, suspended after the first match, and giving the winger Javier Manjarin his first start, which he marked with a goal after 11 minutes.
There could be no complaints about its execution - a shot placed with precision by the 26-year-old, who side-footed beyond the reach of Prunea from a little inside the penalty area - even if there was good fortune in its creation. The ball ran kindly for Manjarin after a driven effort by Jose Emilio Amavisca had struck the heel of Pizzi. What is more, it went against the run of a first half in which the Romanians did much to restore their pride. The beauty of Romania's play in that period, the measure of what the tournament will miss in their absence, was captured in the goal that levelled the score after 29 minutes.
Worked out of their own penalty area by Anton Dobos and Dan Petrescu, the ball travelled to the halfway line, where Ovidiu Stinga played the neatest of one-twos with Gheorghe Hagi near the right-hand touchline before allowing Florin Raducioiu at last to spring Spain's offside trap with a perfectly weighted pass. Raducioiu finished the move expertly, sliding the ball under the advancing Andoni Zubizarreta.
To be on terms at that stage was Romania's right, Spain having been content to defend, allowing Romania to dominate possession while they waited for the chance to attack on the break. It was a dangerous game. Indeed, Romania might have established a clear advantage. Just before the Spaniards scored, a clever free-kick deserved better than to end in a goal-kick to Spain when Gica Popescu's shot clearly deflected wide off a defender's body.
In the second half, Spain, reshaped by three substitutions, proved a different proposition. Within minutes of the restart, Prunea was stretching to guide a dipping shot by Manjarin over his crossbar. Then he saved at close range from Amavisca, who should have scored from Alfonso's return pass.
Then Romania had Petrescu to thank for keeping them level, the Chelsea defender defying Fernando Hierro after Amor, released by Kiko on the right had crossed behind the Romanian defence.
Finally came the goal, made possible by Alfonso's mighty leap at the far post to direct Sergi's deep left-wing cross back across goal, his efforts rewarded when Amor flung himself forward to head home.
Poor Romania had not even the consolation of a point after a tournament marred by the bitter aftermath of Dorinel Munteanu's "goal that never was" against Bulgaria. For Hagi, winning his 100th cap, the only other memento was a yellow card shown after he kicked the ball away when a decision went against him.
SPAIN: (4-1-4-1): Zubizarreta (Valencia); Lopez (Atletico Madrid), Alkorta (Real Madrid), Abelardo (Barcelona), Sergi (Barcelona); Hierro (Real Madrid); Manjarin (Deportivo La Coruna), Kiko (Atletico Madrid), Nadal (Barcelona), Amavisca (Real Madrid); Pizzi (Tenerife). Substitutes: Amor (Barcelona) for Abelardo, 63; Guerrero (Athletic Bilbao) for Amavisca,71; Alfonso (Real Betis) for Pizzi, 56.
ROMANIA (5-2-2-1): Prunea (Dinamo Bucharest); Petrescu (Chelsea), Prodan (Steaua Bucharest), Dobos (Steaua Bucharest), Galca (Steaua Bucharest), Selymes (Anderlecht); Popescu (Barcelona), Hagi (Barcelona); Stinga (Salamanca), Ilie (Steaua Bucharest); Raducioiu (Espanol). Substitutes: Lupescu (Bayer Leverkusen for Prodan, 86; Vladoiu (Steaua Bucharest) for Raducioiu, 76; Munteanu (Cologne) for Ilie, 64.
Bookings: Spain: Kiko, Nadal. Romania: Popescu, Hagi, Ilie, Galca.
Referee: A Cakar (Turkey)
Man of the match: Manjarin.