Two second-half goals from Spanish La Liga 2 outfit CD Leganes made the difference as Wrexham suffered a pre-season friendly defeat in Spain.
Juan Munoz’s penalty and a late strike by Aviles made the difference as Wrexham enjoyed their second run-out of the summer with another 22 players getting game time.
Elliot Lee made his first appearance in a Wrexham shirt, while Christian Dibble, Tom Jenkins and Will Mountfield all featured after the break for the first time this summer.
Tom O’Connor and Aaron Hayden both picked up yellow cards in the first part of the first half, while Hayden headed wide from a Ben Tozer throw-in.
After the water break, Paul Mullin fired over at the back post from Tom O’Connor’s crossed free-kick, while Lee’s pass to Callum McFadzean on 40 minutes led to Wrexham’s best chance; Javi Garrido producing a good save.
Aaron James and James Jones replaced Aaron Hayden and Elliot Lee in Wrexham’s first two changes, but Leganes took the lead on 50 minutes.
Luke Young’s foul resulted in a penalty, from which Juan Munoz sent goalkeeper Mark Howard the wrong way.
On the hour, Wrexham made a further nine changes with the likes of Dibble, Jenkins, Mountfield, Dan Jones and Dan Davies all introduced.
Jake Bickerstaff had an effort saved for Wrexham, while Christian Dibble kept the score at 1-0 with a couple of fine saves, including one reflex stop to deny goalscorer Munoz.
Leganes finally got their second, however, with five minutes to play when a long ball over the top presented them with a 2v1 against Dibble. The ball was squared for Aviles to tap into an empty net.
Wrexham continue their pre-season preparations on Saturday, with another fixture at the Hotel Golf Campoamor, this time against Nottingham Forest Under-21s, kicking-off at 7pm local time.
Wrexham: Howard (Dibble 60), Hayden (James 44), Tozer (David Jones 60), Cleworth (D.Davies 60), McAlinden (Dan Jones 60), Young (Mountfield 60), O’Connor (Jenkins 60), McFadzean (Bickerstaff 60), Lee (J.Jones 46), Mullin (Angus 60), Palmer (Hyde 60).
Leganes: Javi Garrido, Nyom (Jorge Saenz 46), Omeruo (Sergio 46), Gaku (Rentero 72), Jose Arnaiz (Aviles 46), Luis Perea (Qasmi 46), Kravets (Juan Munoz 46), Mejias (Javi Hernandez 46), Naim (Caio Lopes 46), William de Camargo (Lalo 46 (Felix Quaye 80)), Cisse (Alex Gil 72)