2010 World Cup winners Spain managed to edge Iran 1-0 in their Group B game of Russia 2018.
The game which was expected to be one-sided was equally so, with Spain dominating possession.
However the Spanish found it difficult to break down Iran as they stood their grounds and were discipline in defence.
The Spanish threw everything at them but couldn't penetrate the Iranian defence and the game ended goalless in the first half.
Spain who had drawn their first game against Portugal needed to win at all cost.
They started the second half with intensity and finally got the breakthrough in the 54th minute.
Iniesta fed a pass through to Costa, who looked to roll away from his marker on the edge of the area. Ramin across to cover but his tackle hit Costa and rebounded past Beiranvand.
Read also:Russia 2018: Luis Suarez's strike eliminates Saudi Arabia
That was a rare goal for the Spanish but the win is all that matters. Spain eventually won 1-0 and will just need a draw in their final game against Morocco to progress to the next stage.