Martin Dubravka had a nightmare as Spain thrash Slovakia to qualify for Euro 2020 last 16, La Roja will now face Croatia in Copenhagen on Monday
Spain clinched a spot in the UEFA EURO 2020 round of 16 with a win that equalled the competition's record win.
Martin Dúbravka saved an early penalty from Alvaro Morata, but his own goal opened the scoring.
Aymeric Laporte's header made it 2-0 just before halftime.
Pablo Sarabia and Ferran Torres both scored spectacular goals before another Slovakia own goal.
Due to Sweden's dramatic loss of Poland, Slovakia will not advance as one of the four best third-placed teams; Spain finished second and will face Croatia in the Round of 16 in Copenhagen on Monday.
Spain needed a win to advance without relying on Poland beating Sweden, but despite a promising start, it was ominous when Morata's 12th-minute penalty was saved by Dúbravka after Jakub Hromada took down Koke in the box.
After a Sarabia drive had bounced high off the crossbar, the Slovakia goalkeeper ended up palming a dipping ball into his own net on the half-hour mark.
Gerard Moreno pulled wide and crossed for Laporte to loop a header past Dúbravka just before halftime to make it 2-0.
The third came early in the second half, when a fluid move found Jordi Alba on the left flank, and his low cross found Sarabia, who drove the ball in with his body turned away from goal.
On 66 minutes, Ferran Torres came on and made it 4-0 almost immediately with a sneaky flick through his legs from Sarabia's cross.
Pau Torres, another substitute, made an immediate impact with a header that rebounded off Dúbravka and was deflected into his own net by Juraj Kucka.
Man of the Match: Sergio Busquets (Spain)
What the players and managers said
Luis Enrique, Spain coach: "Not every single thing came off for us but I'm satisfied because we made the fans enjoy themselves and my players are very happy with what they did. The atmosphere was superb and we now can't wait for the next match. I warned everyone that when the cork was out of the bottle the champagne would flow and that's what happened here. But we have things to improve, for sure."
Sergio Busquets, Spain captain: "This is the way we want to continue performing. It's going to bring confidence and morale. Now we have to play the World Cup runners-up. Hopefully, we play at this level to get one step closer to our objective."
Aymeric Laporte, Spain defender: "I guess time stopped a little bit when the ball was dropping towards me for my goal and my head was filled with thoughts about where to try and head the ball to beat the keeper. I've said it from the start: this is a dream for me and I'm very happy indeed."
Štefan Tarkovič, Slovakia coach: "It is difficult to play against such opposition. You need to be well organised, you need to play well in defence and we didn't do that. To make such mistakes against Spain is simply not acceptable. We changed certain things and the formation as well but, after the third goal, it turned into an exhibition match for Spain."
Martin Dúbravka, Slovakia goalkeeper: "The first goal was my fault. I will regret this for a long time, but it's happened. Then came the second and it was tough for us to the end of the game. Spain that controlled the game much more easily after that."
Ondrej Duda, Slovakia midfielder: "More than our elimination, I regret this margin of defeat. That isn't how we wanted to say goodbye to the tournament. We need to forget about today´s game quickly."