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.

7. Mateusz Klich
7 - Produced a lovely controlled finish to draw Leeds level and played some lovely passes, particularly in the first half. More difficult in the second half as Villareal pushed for a leveller. Played a bit deeper than usual in front of a back three. Picture by Bruce Rollinson.

8. Raphinha
7 - A bit of a nearly night but again with his class obvious. Played lots of dangerous passes, through balls and crosses and could be coming to the boil at just the right time after a quiet start to the summer. Photo by Tony Marshall/Getty Images.

9. Jack Harrison
7 - Loads of energy and running and produced a lovely through ball for the Bamford chip which was cleared off the line. Swapped sides from the left flank to the right after Costa replaced Raphinha. Photo by Lewis Storey/Getty Images.

10. Rodrigo
6 - Denied by a good save when clean through in the first half. Again played just behind Bamford in the no 10 role and did okay without getting near Bamford's levels. Linked up well with Raphinha. Subbed at the break. Photo by Getty.

11. Patrick Bamford
8 - Excellent, and pushing towards a 9/10. Could have had a hat-trick. Had a real spring in his step and reacted quickly for his goal. Denied a stone wall penalty, hit the bar and saw his deft chip cleared off the line. Picture by Bruce Rollinson.

12. Kalvin Phillips
6 - On at the break and almost playing right back at times, on the right of a back three. Made one typically brilliant Phillips tackle and battled away without being anywhere near at his best in the CDM role. Photo by Paul Ellis - Pool/Getty Images.

