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.
Uruguay's Luis Suarez, right, and Russia's Sergei Ignashevich fight for the ball during the group A match between Uruguay and Russia at the 2018 soccer World Cup at the Samara Arena in Samara, Russia, Monday, June 25, 2018. (AP Photo/Rebecca Blackwell)
Egypt's Marwan Mohsen, front, and Saudi Arabia's Osama Hawsawi jump for the ball during the group A match between Saudi Arabia and Egypt at the 2018 soccer World Cup at the Volgograd Arena in Volgograd, Russia, Monday, June 25, 2018. (AP Photo/Andrew Medichini)
Saudi Arabia's Osama Hawsawi, left, and Egypt's Mohamed Salah challenge for the ball during the group A match between Saudi Arabia and Egypt at the 2018 soccer World Cup at the Volgograd Arena in Volgograd, Russia, Monday, June 25, 2018. (AP Photo/Darko Vojinovic)
Uruguay's Edinson Cavani, left, and Russia's Fyodor Kudryashov challenge for the ball during the group A match between Uruguay and Russia at the 2018 soccer World Cup at the Samara Arena in Samara, Russia, Monday, June 25, 2018. (AP Photo/Hassan Ammar)
Russia's Igor Smolnikov stops Uruguay's Cristhian Stuani during the group A match between Uruguay and Russia at the 2018 soccer World Cup at the Samara Arena in Samara, Russia, Monday, June 25, 2018. (AP Photo/Rebecca Blackwell)
Russia's Igor Smolnikov, left, and Uruguay's Diego Laxalt challenge for the ball during the group A match between Uruguay and Russia at the 2018 soccer World Cup at the Samara Arena in Samara, Russia, Monday, June 25, 2018. (AP Photo/Hassan Ammar)
Russia's Alexei Miranchuk, left, stops Uruguay's Nahitan Nandez during the group A match between Uruguay and Russia at the 2018 soccer World Cup at the Samara Arena in Samara, Russia, Monday, June 25, 2018. (AP Photo/Rebecca Blackwell)
Uruguay's Lucas Torreira, from left, Russia's Artyom Dzyuba and Uruguay's Sebastian Coates challenge for the ball during the group A match between Uruguay and Russia at the 2018 soccer World Cup at the Samara Arena in Samara, Russia, Monday, June 25, 2018. (AP Photo/Hassan Ammar)
Uruguay's Diego Laxalt, left, and Russia's Artyom Dzyuba challenge for the ball during the group A match between Uruguay and Russia at the 2018 soccer World Cup at the Samara Arena in Samara, Russia, Monday, June 25, 2018. (AP Photo/Hassan Ammar)
Uruguay's Edinson Cavani celebrates after scoring his team's third goal during the group A match between Uruguay and Russia at the 2018 soccer World Cup at the Samara Arena in Samara, Russia, Monday, June 25, 2018. (AP Photo/Martin Meissner)
Saudi Arabia's Salem Aldawsari celebrates with a flip after scoring his side's second goal during the group A match between Saudi Arabia and Egypt at the 2018 soccer World Cup at the Volgograd Arena in Volgograd, Russia, Monday, June 25, 2018. (AP Photo/Darko Vojinovic)
Spain's Isco, 3rd left, scores his side's opening goal during the group B match between Spain and Morocco at the 2018 soccer World Cup at the Kaliningrad Stadium in Kaliningrad, Russia, Monday, June 25, 2018. (AP Photo/Manu Fernandez)
Morocco's Hakim Ziyach, left, challenges for the ball with Spain's Dani Carvajal during the group B match between Spain and Morocco at the 2018 soccer World Cup at the Kaliningrad Stadium in Kaliningrad, Russia, Monday, June 25, 2018. (AP Photo/Petr David Josek)
Portugal's Cristiano Ronaldo, collides with Iran's Alireza Jahanbakhsh during the group B match between Iran and Portugal at the 2018 soccer World Cup at the Mordovia Arena in Saransk, Russia, Monday, June 25, 2018. (AP Photo/Francisco Seco)
Spain's Sergio Ramos, right falls, loosing his shoe after a tackle by Morocco's Noureddine Amrabat, left, during the group B match between Spain and Morocco at the 2018 soccer World Cup at the Kaliningrad Stadium in Kaliningrad, Russia, Monday, June 25, 2018. (AP Photo/Petr David Josek)
Portugal's Cristiano Ronaldo, right, and Iran's Omid Ebrahimi challenge for the ball during the group B match between Iran and Portugal at the 2018 soccer World Cup at the Mordovia Arena in Saransk, Russia, Monday, June 25, 2018. (AP Photo/Pavel Golovkin)
Iran's Saeid Ezatolahi front, falls as he is tackled by Portugal's Ricardo Quaresma during the group B match between Iran and Portugal at the 2018 soccer World Cup at the Mordovia Arena in Saransk, Russia, Monday, June 25, 2018. (AP Photo/Francisco Seco)
Iran goalkeeper Ali Beiranvand reacts at the end of the group B match between Iran and Portugal at the 2018 soccer World Cup at the Mordovia Arena in Saransk, Russia, Monday, June 25, 2018. (AP Photo/Darko Bandic)