Spain opened their Confederations Cup campaign in style as the world and European champions outclassed Uruguay in Recife.
Former Arsenal player Cesc Fabregas had already hit a post when Pedro's 22-yard attempt was deflected off Uruguay defender Diego Lugano into the net.
Roberto Soldado doubled the lead from just inside the area after a clever pass by Fabregas before the interval.
Uruguay scored a consolation through Luis Suarez's fine 30-yard free-kick.
But had Uruguay snatched a dramatic equaliser it would have been unfair on Spain, who produced a typically dominant performance in Brazil.
For large periods of the match the South Americans were reduced to chasing shadows but when they did have the ball they were swiftly closed down by their ruthless opponents.
Three years after suffering their last tournament defeat - a 1-0 loss to Switzerland in the group stage at the 2010 World Cup in South Africa - Vicente del Bosque's side showed why they are the team to beat 12 months before they are due to defend their world title.
They are now unbeaten in their last 23 outings - 18 of which have ended in victory - after Uruguay found themselves on the end of a Spanish masterclass.
Uruguay included eight of the side that finished the last World Cup in fourth place yet they were 2-0 behind by the 32nd minute as Spain controlled the opening game in Group B.
Having enjoyed 92% of the possession in the opening nine minutes, a post prevented Fabregas from giving the Spanish a 10th-minute lead before Barcelona team-mate Andres Iniesta was denied by goalkeeper Fernando Muslera.
The goal they had been threatening duly arrived in the 20th minute, Pedro's shot taking a wicked deflection off Lugano, who finished last season on loan at Malaga from Paris St-Germain, before finding the net.
It might have required a touch of fortune for Spain to take the lead but it was nothing less than they deserved.
Edinson Cavani, who has been linked with a move to the Premier League, did force Iker Casillas into a rare save with a header from a well worked free-kick in the 30th minute.
But Uruguay, who included Southampton's Gaston Ramirez, were second best throughout.
They fell further behind after a clever pass by Fabregas allowed Soldado to produce a crisp finish from just inside the area.
Gerard Pique should have increased the lead six minutes before the break but was denied by a point-blank save by Muslera.
Uruguay qualified stylishly for the tournament after winning a record 15th Copa America title in 2011.
But it was not until two minutes from the end that they showed real quality, Liverpool forward Suarez beating Casillas, who was making his 146th appearance for his country, with a sublime curling free kick.
Spain manager Vicente del Bosque:
"We were really tired towards the end of the match. When you are playing in temperatures like this it's normal that should happen.
"We played an excellent first half and I think we also played very well in the second period, but we suffered a bit at the end.
"They are three magnificent points which put us in a very good position to get through to the semi-finals."
Uruguay manager Oscar Tabarez:
"It could have been catastrophic for us, but we improved and our professional image was rescued."
Uruguay striker Luis Suarez:
"It's very difficult to generate any kind of danger when you don't touch the ball.
"Spain are the best side in the world. They are a candidate to win the World Cup."