Spain held onto a one goal lead to edge past Cesare Prandelli's men in Madrid in the repeat of the Euro 2012 final
The Barcelona man was at the heart of the majority of Spain's best attacks at the Vicente Calderon, and he was rewarded for a fine performance when he swept home the winner from close-range in the second-half.
Italy played their part in an entertaining encounter, but Vicente del Bosque's men were good value for a win that is sure to provide a timely confidence boost as they continue their preparations towards the start of the global showpiece in Brazil.
Spain enjoyed the majority of possession in the first-half, though Italy went closest to breaking the deadlock when Alessio Cerci's cross-cum-shot deceived Iker Casillas and hit the post.
David Silva was introduced after the break for the hosts and he was instrumental in several Spain attacks, but it was Pedro who settled the match with his close-range effort on 64 minutes.
Del Bosque handed a long-awaited debut to Diego Costa after the Atletico Madrid man declared his allegiance to the Spanish from the country of his birth, Brazil.
Meanwhile, Cesare Prandelli handed an international debut to Parma centre-back Gabriel Paletta.
In an end-to-end opening, Italy went closest to breaking the deadlock in fortuitous circumstances on four minutes when Cerci's mis-hit cross from the right-hand side of the box looped over Casillas and rebounded off the far post.
Spain responded in kind when Pedro's low drive from 25 yards was well parried by Gianluigi Buffon.
Pedro was involved again in the 20th minute, the Barcelona forward cutting in from the left before sliding in Costa, whose first-time shot was well blocked by Paletta.
Italian opportunities were proving few and far between, but Pablo Daniel Osvaldo should have done better on the half-hour mark when he collected Claudio Marchisio's neat flick before advancing towards goal and curling a left-footed shot wide.
Spain introduced Xabi Alonso and Silva for the second-half, and the duo linked up for the first opportunity after the break on 50 minutes, the former finding the latter on the edge of the box as he in turn slipped the ball to Thiago Alcantara, but the Bayern Munich midfielder was thwarted by Buffon.
Manchester City winger Silva was proving a constant menace to the Italy defence and his through ball found Pedro soon afterwards. His cut-back in turn found Costa, but he could only shoot wide from eight yards.
Spain's relentless second-half pressure finally told just after the hour mark when Silva's attempted one-two with Andres Iniesta fell kindly for Pedro, who squeezed his shot under Buffon, although the Italian may feel he could have done better in keeping the shot out.
With 10 minutes remaining Costa turned in the penalty area, only to see his shot sail wide.
Pedro then departed to a warm reception, with his replacement Santi Cazorla driving a shot narrowly over the crossbar in the closing stages.