(CNN) -- If ever there was a David versus Goliath clash in international football this was it.
Spain, the reigning world and European champions taking on Tahiti, ranked 138th by the game's governing body FIFA, one place below Syria.
Almost all of Tahiti's squad are amateur players -- nine are unemployed -- and their coach Eddy Etaeta even admitted before the tournament began: "We are not here to win."
After a heavy defeat in their opening Confederations Cup game against Nigeria, Etaeta declared their dream had come true -- solely because they found the net in a 6-1 reverse.
There was to be no goal this time round as they were put to the sword by Spain who completed a 10-0 victory to all-but secure a semifinal berth.
That represented the biggest in the history of the competition that pits the champions of each FIFA confederation against each other and acts as a precursor to next year's World Cup in Brazil.
But Tahiti's squad were afforded a standing ovation from the 71,000 crowd, who backed them throughout the match. Before the game there was a heavy police presence outside the ground in Rio in response to the ongoing protests in Brazil.
"Tahiti set an example in terms of fair play and went forward whenever they had the opportunity," Spain coach Vicente del Bosque said.
"We didn't score more goals because they didn't let us. This game hasn't damaged football in any way. In some ways it's made it even stronger."
After handing over pendants to their opponents prior to kickoff, Tahiti maintained parity for less than five minutes as Chelsea striker Fernando Torres beat goalkeeper Mikael Roche at his near post to put the "La Roja" ahead.
Any Tahiti foray into Spain's half was roared by the crowd but Del Bosque's side soon fired two goals in the space of two minutes as David Silva and Torres found the net.
David Villa grabbed a goal either side of the break before Torres sealed his hat-trick just before the hour mark -- making him the first player to do it twice in the tournament following his three against New Zealand in 2009.
Villa's treble followed soon after, and Juan Mata then got number eight.
Torres missed the chance to claim his fourth, sending a penalty over the crossbar after Ricky Aitamai was adjudged to have handled the ball.
But he made amends a minute later as he rounded Roche to slot into an empty net. Silva then got his second, firing home from inside the area.
The crowd were willing Tahiti forward but the closest they came to scoring was when Lorenzo Tehau narrowly failed to latch onto Marama Vahirua's pass, but the offside flag had gone up.
Upon the final whistle, Tahiti gave Spain a guard of honor as the world champions left the pitch before the minnows took the applause of the crowd.
However, the battle for semifinal places will go to the last round of Group B matches, following Uruguay's 2-1 victory over Uruguay in Thursday's late match.
Veteran striker Diego Forlan celebrated his landmark 100th international appearance -- becoming the first Uruguayan to do so -- by scoring the winner six minutes after halftime.
The 34-year-old finished off a fine move involving strike partners Edison Cavani and Luis Suarez, ending his run of 12 games without a goal for the South American champions.
It was his 34th goal for his country, putting him ahead of Suarez in the all-time list.
Captain Diego Lugano gave Uruguay the lead in the 19th minute but Chelsea midfielder John Obi Mikel equalized eight minutes before the break.
If Uruguay beat Tahiti on Sunday, then Nigeria's Super Eagles would have to inflict Spain's first defeat of the tournament in order to qualify.