Spain is in position to comfortably move past Iran after a thrilling 3-3 draw with Portugal to open World Cup play.