The England international was part of a strong United line-up that also featured Nemanja Vidic, Nani and Javier Hernandez - and he completed a useful workout to step up his recovery from a hamstring injury.
David Moyes' side ran out 3-0 winners against the Spanish outfit in a game held at the the club's training ground in Carrington.
Rooney has been missing for much of the club's pre-season campaign after returning early from the tour of Asia and Moyes had previously stated that the 27-year-old would likely return for the friendly against Swedish outfit AIK on August 6.
However, he was given an early run-out against the Liga side.
The former Everton striker's future has been shrouded in doubt throughout the close-season, with Chelsea confirming a bid for his services - although Moyes remains adamant that the Premier League champions will not sell.