IR Iran now leads Group B with 3 points, followed by Spain and Portugal with 1 point each.
The second half saw Spain attack with more intent but it was a stroke of luck that saw them take the lead in the 54th minute.
After a pass from Andres Iniesta comes through Costa gets the ball under control and dribbles it before curling it into Iran's net, therefore scoring the opening goal for Spain.
Iran thought they had levelled things up 10 minutes later, but Saeid Ezatolahi's goal was ruled offside by the referee's assistant, a decision then backed up by VAR. Spain was lucky not to concede toward the end as Mehdi Taremi connected with a cross from Ansarifard, but his header from close range went over the crossbar.
Spain will face Morroco in their final group stage game on Monday, June 25 while Iran will face Portugal on the same day. They took a while to get into the game.
Iran's resistance was almost broken twice in quick succession at the start of the second period.
Spain celebrate a Diego Costa goal against Iran.
Iran have never beaten a European side at a World Cup - their only previous victory was a 2-1 win over the United States in France in 1998.
Explosion at Hawaii volcano spews ash as lava flows into sea
The eruption has also had a toll on the area's tourism industry, with many afraid to travel to the island. Fissure 8 continued to feed a vigorous channelized lava flow to the east of the vent on Saturday morning.
Kan. deputy killed, another critical after shooting during inmate transport
The other deputy had not been identified as of Friday evening, but was in critical condition at the University of Kansas Hospital. Wyandotte County Sheriff's Deputy Theresa King , a 13-year veteran of the department, has died following Friday's shooting.
Harry and Meghan's first overseas tour revealed
It's been speculated Harry and Meghan may have been on honeymoon but that has not been confirmed by the palace. During the ceremony, The Queen is greeted by a Royal salute and carries out an inspection of the troops.
Where is FIFA World Cup 2018 Iran vs Spain match being played?
The World Cup match between Spain and Iran will be broadcast live on FS1.
As for Spain, they will be slightly frustrated with coming away with just a point in their opening 3-3 draw with Portugal.
You can stream the World Cup games on fuboTV (Try for free).
One of those goals came from a goalkeeping howler from David de Gea, which have also turned the spotlight on the goalkeeper's form going into the second game at Kazan.
Spain coach Fernando Hierro welcomed Real Madrid's Dani Carvajal back into the starting line-up following his recovery from a hamstring injury suffered in the Champions League final win over Liverpool.
Diego Costa scored a fine brace in the opener and is likely to start again against Iran.
"A World Cup match is completely different from all others, it's incredibly handsome", he confirmed.
- South Korea and USA discuss future of joint war games
- Italy economy minister cancels France meeting over migrant tensions
- Spanish PM lets migrant boat dock at Valencia
- Phil Mickelson freestyles hole 13 of US Open Championship
- Defiant charity to continue Aquarius migrant rescues
- NK leader arrives in Singapore for historic summit with Trump
- Japan make history with win over 10-man Colombia
- Day after summit, Trump claims North Korea 'no longer a nuclear threat'
- Southgate wants England players to entertain nation's fans
- Mexico stuns holders Germany in opener