Spain, the world's top-ranked side, spurned several first-half chances before substitute Roberto Soldado found the net and broke the deadlock after 69 minutes.
Ireland went close to equalising several times, forcing a save, striking the crossbar and having a goal disallowed for offside to no avail.
Then Juan Mata put the result beyond doubt when he scored a second goal for Spain in the 88th minute with a neat finish after he was played in by Santi Cazorla.
Spain dominated the first half, monopolising possession, but had nothing to show for their superiority as they wasted several good chances.
Gerard Pique came close in the 19th minute when his header was cleared off the line by Paul McShane and David Silva made a hash of a rebound where he could have scored in the 41st minute.
Spain took a while to re-establish their patterns amid a flurry of second half substitutions. However, when they did, a goal soon followed, Alvaro Arbeloa flicking the ball artfully to find some space on the edge of the box and laying off for David Villa's replacement Soldado to angle his finish past David Forde.
Ireland came desperately close to levelling the scores in the 82nd minute, first when James McClean's rasping strike was tipped around the bar by Iker Casillas.
Moments later they did in fact get the ball across the line, only for Sean St Ledger's scrambled effort from the resulting corner to be ruled out for offside.
Irish indignation at the decision was enhanced moments later when Mata clipped home after some tidy interplay with Cazorla, although it was at least a closer contest than the two sides' last meeting, when Spain won 4-0 at Euro 2012.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.