The Netherlands claimed their quarter-finals place as a comfortable win against Latvia was combined with Germany's defeat by the Czech Republic.
Ruud van Nistelrooy scored twice and Roy Makaay added a third late on, by which time the Czechs were beating Germany. The Netherlands finish second in Group D, two points ahead of Germany, and meet Sweden on Saturday. Latvia's debut ends with a single point.
As expected, Oranje coach Dick Advocaat made two changes from the side that lost 3-2 to the Czech Republic, bringing in Michael Reiziger at right-back to replace the suspended John Heitinga, while Frank De Boer made his first start of the tournament for the injured Wilfred Bouma, his 111th cap. Aleksandrs Starkovs kept faith with the same XI who started Latvia's draw with Germany on Saturday.
It was the first time these two countries had met and the Netherlands went on the offensive straight from the kick-off. Within a minute Van Nistelrooy headed Giovanni van Bronckhorst's throw-in into the path of Clarence Seedorf on the edge of the Latvia penalty box, but the shot was high. Māris Verpakovskis demonstrated his lightning pace at the other end, outstripping De Boer and Jaap Stam before firing a shot into the side-netting.
Phillip Cocu tested Aleksandrs Koliņko with a powerful shot from just outside the area, the FC Rostov man getting down smartly to turn the ball round the post. A minute later, Van Nistelrooy should have opened the scoring after a sumptuous pass from Arjen Robben had put him through on goal, but having rounded Koliņko he somehow contrived to hit his shot back into the goalkeeper's chest.
His next opportunity was altogether easier to convert when, on 26 minutes, Vitālijs Astafjevs was adjudged to have tripped Edgar Davids in the box. Van Nistelrooy stepped up and coolly slotted the ball low into the corner of the net for his third goal of the tournament.
With news of the Czech Republic's equaliser against Germany filtering through, the Netherlands gained even more zip and doubled their lead. A Seedorf free-kick from wide on the left was met by Cocu at the back post and his downward header was nodded over the line by Van Nistelrooy.
Latvia came out of their defensive shell at start of the second half and went close on two occasions. On 47 minutes, Andrejs Prohorenkovs combined well with Verpakovskis, but his shot was comfortably saved by Edwin van der Sar. Andrejs Rubins went close again two minutes later when he cut in from the right but his effort deflected wide.
Van Nistelrooy could have had his hat-trick just after the hour mark but his low shot was saved by Koliņko. His team thought they had scored a third on 73 minutes when Seedorf tapped in after Koliņko failed to deal with Cocu's free-kick, but the referee ruled that an infringement had taken place before the ball crossed the line. Not that it mattered.
By now everyone in the stadium knew that Milan Baroš had put the Czech Republic ahead against Germany and the icing on the cake came with Makaay's goal six minutes from time after a superb jinking run by Robben.