Brais Mendez scored on his debut as Spain beat Bosnia-Herzegovina 1-0 at Estadio de Gran Canaria.
The 21-year-old attacker, who plays his club football for Celta Vigo, settled the game 11 minutes from time when he turned home the rebound after Isco's effort had been saved.
It helped lift the mood towards the end of a disappointing day for Spain after England's late winner against Croatia denied Luis Enrique's side a place in the Nations League Finals.
Spain made nine changes to the team which lost to Croatia in that competition on Thursday. Only Dani Ceballos and Isco remained while Mario Hermoso made his debut as the fringe players got a chance to try to impress.
A largely uneventful first half finished goalless although Bosnia could have scored inside the opening minute but Kepa Arrizabalaga blocked Edin Visca's shot.
Spain eventually settled and began to impose their possession-based game on their opponents, although without creating any real chances. Isco dragged a tame effort too close to the goalkeeper as half-time approached.
The second half was much more exciting as a series of chances were wasted by Spain – and Alvaro Morata in particular.
The Chelsea striker missed the target with a free header shortly after the restart before firing a shot over the crossbar when he raced through on goal.
At the other end, Bosnia spurned another glorious opportunity to score when Rade Krunic was unable to get enough contact on the ball to turn Visca's cross goalwards.
Morata's poor night continued after 58 minutes when he somehow bundled the ball wide from inside the six-yard box after Marco Asensio's shot was pushed out into his path by the goalkeeper.
Ibrahim Sehic saved well to deny Moreno Rodrigo but Spain finally made the breakthrough in the 79th minute through Mendez.
The 21-year-old almost made it a quick-fire double but his shot from the edge of the area flew just wide.
Asensio should have added a second goal in injury time as Sehic saved but it mattered not and Spain finished the year with a victory after back-to-back 3-2 defeats in the Nations League.
ga('create', 'UA-72310761-1', 'auto', {'name': 'pacontentapi'});
ga('pacontentapi.set', 'referrer', location.origin);
ga('pacontentapi.set', 'dimension1', 'By Press Association Sport staff');
ga('pacontentapi.set', 'dimension2', 'de718e75-df44-4259-b0fe-4338f2e00452');
ga('pacontentapi.set', 'dimension3', 'paservice:sport,paservice:sport:football,paservice:sport:match-reports,paservice:sport:world');
ga('pacontentapi.set', 'dimension6', 'story');
ga('pacontentapi.set', 'dimension7', 'composite');
ga('pacontentapi.set', 'dimension8', null);
ga('pacontentapi.set', 'dimension9', 'sport:football');
ga('pacontentapi.send', 'pageview', { 'location': location.href, 'page': (location.pathname + location.search + location.hash), 'title': 'Brais Mendez\u2019s debut goal gives Spain friendly win over Bosnia'});