Spain opened their Confederations Cup campaign with a narrow 2-1 win over Uruguay which the world and European champions dominated for long periods in Recife.
Pedro's deflected shot and a fine finish from Roberto Soldado put Spain 2-0 ahead before a late free-kick from Luis Suarez gave Vicente del Bosque's men some nervous moments towards the end.
Jordi Alba's cross from the left was just too far in front of Soldado with five minutes gone as Spain dominated from the start.
Spain went even closer five minutes later when Alba slid the ball across the edge of the area and Cesc Fabregas' shot came back off the post.
Andres Iniesta had a shot from the edge of the area but Fernando Muslera gathered at the second attempt. Spain took the lead after 20 minutes when Pedro's shot from the edge of the area was deflected past Muslera by Diego Lugano.
Uruguay's first chance fell to Edinson Cavani when he ran behind the Spain defence after half an hour but his flicked header to Luis Suarez's free-kick was straight at Iker Casillas.
Soldado increased the lead shortly after when Fabregas played him in on the edge of the area and he took a touch before firing home.
Four minutes into the second half Soldado was again just shy of making contact to a ball slid across the area.
With three minutes to go Suarez reduced the deficit when he curled a free-kick from the right just inside the near post and out of the stretch of the diving Casillas.
Both sides had chances to score in four minutes of added time but failed to do so.