Costa's ricochetted goal enough for Spain against IR Iran
Diego Costa's second-half strike proved enough for Spain to squeeze past Iran in Kazan and move into a commanding position in their bid to qualify from Group B.
Costa broke Iran's sturdy resistance with a slightly fortuitous 54th-minute goal, and the Spaniards were lucky to hold onto their lead with Saeid Ezatolahi's effort ruled out for offside after a video assistant referee check six minutes later.
Their 1-0 win leaves Fernando Hierro's men joint-top of their World Cup group with Portugal on four points, but Iran still have plenty to play for just a point behind heading into their final match.
The favourites dominated the first period but were continually frustrated in their quest to break down a resolute Iran side steeled by their dramatic opening win over Morocco.
David Silva fired a 25th-minute free-kick straight at Iran keeper Alireza Beiranvand, and the busy Ezatolahi dispossessed Andres Iniesta as he shaped to shoot on the half-hour.
Defending deeply, it seemed evident the Iranians were playing for set-pieces and Spanish frustration spilled over after Beiranvand's over-the-top reaction to a clash with Costa.
The first half ended with Silva twice denied by a wall of Iranian defenders and half-time merely paused the inevitable as Spain set out in the second half with renewed intent.
Beiranvand hooked a Gerard Pique effort off his line then pulled off a fortunate double save to deny first Sergio Busquets then Lucas Vazquez.
Iran almost grabbed the lead out of nowhere in the 53rd minute when Karim Ansarifard lashed a low shot from the left flank which squeezed into the side-netting.
And Spain made them pay within a minute when Costa turned on an Iniesta through-ball in the box and steered home, after the ball had ricocheted off Ramin Rezaeian and back onto the striker.
Far from signalling a renewed spell of Spanish dominance, the goal revitalised Iran and they thought they had equalised on the hour when Ezatolahi prodded home on the hour only for the referee to rule the strike out after a VAR check for offside.
Iran belatedly continued to press, and they almost grabbed an equaliser again nine minutes from time when Mehdi Taremi headed just over after Vahid Amiri beat Pique and crossed from the left.