A goalkeeping error from Fernando Muslera gifted La Roja the lead after just 16 minutes, as he allowed Cesc Fabregas's long-range effort to slip through his grasp. But La Celeste were deservedly level before half-time as Cristian Rodriguez fired home after latching on to Martin Caceres's clever pass.
However, Pedro proved to be the match-winner in the second-half as he finished calmly from Barcelona team-mate Gerard Pique's pass six minutes after the restart, before tapping home a Fabregas cross to register his ninth goal in his last six internationals.
Vicente del Bosque's men were captained by Carles Puyol on his 100th cap in the absence of Iker Casillas, who was out with a broken bone in his left hand. Cesar Azpilicueta, meanwhile, was making his international debut.
The Chelsea fullback was thankful for the experience shown by his skipper, when he was late in stepping up to play Luis Suarez onside four minutes in but Puyol recovered well to dispossess the Liverpool striker before he could get a shot off.
Spain went in front 12 minutes later thanks to an error from Muslera, as he let Fabregas's swerving drive from 30 yards slip through his hands and into the net.
However, the South Americans responded well to going behind and Victor Valdes had to be quick off his line to prevent Edinson Cavani having a clear run on goal from a long ball over the top moments later.
Puyol then nearly marked his landmark appearance with just his fourth international goal, but he was ruled to be just offside as he volleyed in a cross from the right.
Uruguay were level though just after the half-hour mark as a fine through ball from Caceres found Rodriguez free inside the area, and the Atletico Madrid midfielder slotted the ball low past Valdes.
It took Spain just six minutes into the second period to restore their lead as Pique, who had replaced Puyol at the break, played in Pedro, who drove the ball into Muslera's bottom right-hand corner.
Valdes had to make a stunning save to prevent Uruguay finding a second equaliser as he got an outstretched hand to Cavani's driven effort, before David Villa could easily have had a third for Spain as his effort drifted just over.
Del Bosque then took the chance to also hand debuts to Isco and Mario Suarez as the game began to become stretched, and it was no surprise when Spain broke with great efficiency to kill the game off 15 minutes from time. Villa fed Fabregas and his cross to the back post was perfectly measured for Pedro to slide the ball home.