Marcelo Bielsa's Whites fell behind after just nine seconds following a Robin Koch own goal but United led 2-1 at the break after Mateusz Klich and Patrick Bamford struck.
Unai Emery's La Liga outfit then drew level in the 81st minute through Dani Raba as part of an entertaining contest that was played behind closed doors at York City.
Leeds United writer Lee Sobot hands out the scores from the final warm-up game ahead of next Saturday's Premier League opener against arch rivals Manchester United at Old Trafford.

. Leeds United drew 2-2 with Villarreal in the club's final friendly of the summer
LOOKING ON: Leeds United head coach Marcelo Bielsa, above, whose side begin a second campaign back in the Premier League with next Saturday's clash at arch rivals Manchester United. Photo by Varleys.

. Illan Meslier
7 - Had no chance with Robin Koch's own goal and went on to make some important stops, saving the best until last when somehow keeping out Dia's header from close range in the 88th minute. Photo by Jon Super - Pool/Getty Images.

. Luke Ayling
6 - Deployed as a centre-back in moments of need during pre-season but again looked far more comfortable at right back. Not a vintage Ayling display but solid enough against top opposition. Photo by Lewis Storey/Getty Images

. Liam Cooper
8 - A real captain's performance on the left of a three-man centre back axis. Stood up admirably to a talented front line and produced a thumping header that led to Bamford's goal. Very vocal, particularly in helping Struijk. Photo by Getty Images.

. Pascal Struijk
8 - What a find he has been and can be proud of another very good showing in defence, this time as the middle member of a three-man back three. Put himself about and encouraged along by a vocal Cooper. Photo by Tony Marshall/Getty Images.

1. Illan Meslier
7 - Had no chance with Robin Koch's own goal and went on to make some important stops, saving the best until last when somehow keeping out Dia's header from close range in the 88th minute. Photo by Jon Super - Pool/Getty Images.

2. Luke Ayling
6 - Deployed as a centre-back in moments of need during pre-season but again looked far more comfortable at right back. Not a vintage Ayling display but solid enough against top opposition. Photo by Lewis Storey/Getty Images

3. Liam Cooper
8 - A real captain's performance on the left of a three-man centre back axis. Stood up admirably to a talented front line and produced a thumping header that led to Bamford's goal. Very vocal, particularly in helping Struijk. Photo by Getty Images.

4. Pascal Struijk
8 - What a find he has been and can be proud of another very good showing in defence, this time as the middle member of a three-man back three. Put himself about and encouraged along by a vocal Cooper. Photo by Tony Marshall/Getty Images.

5. Robin Koch
7 - On the right of a three-man centre back axis and had no luck at all in conceding an own goal after nine seconds. Quickly recovered and gave as good has he got to the Villarreal front line. Some neat turns and passes. Subbed at the break.

6. Stuart Dallas
7 - Admitted he was turned too easily for the move that led to Villarreal's equaliser but another strong showing, this time at left back. Always looks better the further forward he gets and lots of quality. Photo by Lewis Storey/Getty Images.