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.
Mark Lawrensonin Recife
"Playing Spain is like playing against fog. You cannot do anything about it. It's not just Spain's passing which is impressive, it is their decision making when they have the ball at their feet which is so good."
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.
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.
Confederations Cup 2013: Spain, Uruguay, Tahiti, Nigeria profiles
It might have required a touch of fortune for Spain to take the lead but it was nothing less than they deserved.
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."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.