Despite dominating the match, the European champions were regularly foiled by the opposition keeper as they failed to meet the pre-game expectations of a prolific win
The hosts made it difficult for Vicente Del Bosque's men with their compact defending but goals from Santiago Cazorla and Cesc Fabregas ensured La Roja went into half time with a comfortable lead. However, they failed to enhance upon that advantage and El Huracan Azul pulled one back through Marc Cintron to earn them a hugely respectable result.
Spain made their dominance clear from the off as they controlled the ball and dictated the play from the whistle. After a couple of limp efforts, Gerard Pique almost found the net in the 12th minute but his header from Cazorla's corner crashed against the post.
Puerto Rico were making things harder for themselves by being sloppy in possession and but it was their keeper Bill Gaudette who kept them level. Midway through the first half he saved a header from Fernando Torres that looked destined for the corner and then he parried a powerful Cazorla effort away from the danger area.
The game was heavily congested in the final third with El Huracan Azul consistently getting all but one man behind the ball, limiting the space in which Spain could move possession around and penetrate the defence.
La Roja continued to be frustrated in their attempts to break the deadlock but they finally broke down the tremendously disciplined Puerto Rico with two goals in the closing stages of the first half.
In the 42nd minute Cazorla opened the scoring with a driven shot from 25 yards that flew past an unsighted Gaudette and moments later it was two. Fabregas added a sublime finish to Jesus Navas' cross with a first-time, cross-goal volley that the keeper had no chance of reaching.
Spain maintained that momentum early in the second half and within a matter of minutes they pressured the opposing goal. However, both Cazorla and Llorente were thwarted by the impressive Gaudette.
The hosts regained some of their organisation soon and La Roja only threatened sporadically through Fabregas, who chipped wide, and Cazorla, who had an effort saved.
Puerto Rico, who are 137 places lower in the Fifa Rankings than the World and European champions, halved the deficit in the 65th minute. A long ball up field was flicked into the path of Cintron by Hector Ramos and despite only being on the pitch for three minutes, he slotted a composed finish into the bottom corner.
In response, Del Bosque's men were guilty of trying to walk the ball in the back of the net and it was not until three minutes from time, when Torres forced another save from Gaudette with a curling effort, that they came close to adding some shine to the result.
Nevertheless, they picked up the win but Spain will be hoping for a far improved performance when they begin their World Cup qualifying campaign against Georgia next month.