Spain struck twice in the second half to overcome a typically spirited Ireland 2-0 in their friendly international at Yankee Stadium on Tuesday.
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 equalizing several times, forcing a save, striking the cross bar and having a goal disallowed for offside but 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.
"Overall I think we showed a good level, we had a lot of possession especially in the first half," Spain coach Vicente del Bosque told reporters.
"Maybe we lacked a little bit in the last pass, but overall we had good control of the ball, we controlled their attacks and their counter-attacks as well.
"We played a good game, we probably could have won by one more goal."
Spain dominated the first half, monopolizing 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 McLean'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 resultant corner 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.
"Psychologically it was important, because in Euro against Spain we lost our class, our confidence," Ireland coach Giovanni Trapattoni said.
"It's good for our young players, a good lesson because they can think about a comparison with these great players, and I'm very happy for them."
Spain are now heading to Brazil for the Confederations Cup while Ireland have a break before preparing for the next round of World Cup qualifiers in September.
Photograph: Mike Stobe/Getty Images