A well-organised Hungary side came close to ending Spain's 100% record in UEFA European Under-21 Championship Group F, but Saúl Ñiguez broke their resistance.
Spain might have suspected their luck was out when captain Iker Muniain missed a penalty after just four minutes, but Ñiguez found his range on 66 minutes after a number of near misses, firing low under Levente Jova after Gerard Deulofeu jinked into the Hungary penalty area and found him on the edge of the area.
Muniain fired wide from the spot on four minutes after Márk Tamás was penalised for a pull on Deulofeu, and Spain looked to make amends. Denis Suárez had a shot beaten away by Jova, and looped a header over the bar within the space of three first-half minutes, but the pressure continued after the interval.
Already certain of a play-off place, Ñiguez's goal was a relief for reigning champions Spain, and they might have made it 2-0 soon afterwards, the impressive Deulofeu surging through the Hungary rearguard before Jova saved his shot from the right. Hungary's best chance came at the death, Patrik Poór hooking over the bar after Spain failed to clear a Roland Ugrai corner.