AP PHOTOS: Spain, Portugal survive crazy Day 12 at World Cup

MOSCOW (AP) The first day of World Cup teams playing simultaneous matches to see who advances came down to the wire – and to video replays – that saw Spain emerge atop its group thanks to a tiebreaker. Spain got the point it needed when Iago Aspas flicked in a Dani Alves cross in stoppage time. Officials first called it offside but counted the goal after reviewing it.

Iran almost knocked out Portugal with penalty kick and a near-miss, both in injury time, but the 1-1 draw was enough for the European champions to advance. They finished second since Spain scored one more goal in the group.

Portugal will face Uruguay, which took the top spot from Russia in a 3-0 win earlier Monday. Russia plays Spain next.