In a clash between a Spanish side who had already secured their spot in next year's World Cup finals and an Armenia team whose outside hopes of going to South Africa had vanished long ago, it was the European champions who came out on top thanks to Juan Mata's second-half penalty.
Mata coolly slotted home what would prove to be the winning goal from the spot in the 64th minute, just six minutes after Armenia had stunned their visitors by equalising through Robert Arzumanyan.
Spain had earlier taken the lead with a brilliant goal from Cesc Fabregas midway through the first half.
The Spanish were clear favourites heading into the match having won all eight of their qualifiers and facing a side who had taken just one point from their opening seven matches in Group Five.
However, Vardan Minasyan's side had claimed a shock 2-1 victory over Belgium in their previous match in Yerevan and they would have been eager to have added an even bigger scalp today in the form of Euro 2008 winners Spain.
But it was not to be for the underdogs, as even though at times they made life difficult for the Spanish, Vicente del Bosque's troops did enough to notch up yet another victory.
In the absence of the injured David Villa, Del Bosque opted to use Fernando Torres as his lone striker with the Liverpool man having recovered from the groin problem that forced him to limp out of training earlier this week.
It was Villarreal playmaker Santi Cazorla who came closest early on though, with an effort from inside the area that just cleared the crossbar, while his fellow midfielder Xavi was denied by Roman Berezovsky in the 17th minute.
Cazorla came even closer in the 31st minute with another effort, but Spain were not to be kept out for much longer as two minutes later Fabregas broke the deadlock.
Xavi played his part with a fantastic pass over the defence and Arsenal captain Fabregas ensured the opportunity was not to be wasted as he lofted a first-time shot past Armenia goalkeeper Berezovsky and into the far corner of the net.
Up until that point decent chances had been at a premium, but Spain might have been celebrating two goals in four minutes only for Berezovsky to produce a fine save to tip Mata's effort around the post.
Spain had to settle for just the one-goal lead at the break though, and with the scoreline unchanged Del Bosque opted to replace Torres with debutant Alvaro Negredo in the 55th minute in a bid to change things around up front.
However, the move did not bring the desired result for Del Bosque as within three minutes of the Sevilla striker's arrival Armenia had claimed a surprise equaliser.
The hosts won a dangerous free-kick deep in Spain territory and they made they most of the opportunity as Artavazd Karamyan's cross into the area was headed past Jose Reina by Arzumanyan.
That sparked wild celebrations amongst the Armenia players and must have come as a huge shock to the system to a Spain side who had only conceded two goals in qualifying before today.
However, the Iberian nation quickly regrouped and found themselves back in front not long after.
Mata won the penalty himself after picking up a fine through-ball from Fabregas before being sent crashing by the outrushing Berezovsky and the Valencia youngster picked himself up to clinically slot home the resulting spot-kick to earn Spain the win.