Old Trafford fell silent before kick-off to honour Her Majesty, who died earlier in the day at the age of 96, while players from both sides wore black armbands in tribute to the monarch.
Cristiano Ronaldo – making just his second start of the season – went close on a number of occasions for the hosts, who registered just three shots on target in the whole game.
The Red Devils’ four-game winning streak was ended shortly before the hour mark when Mendez slotted home from 12 yards after substitute Lisandro Martinez had handled in the area.
United were comfortably the better side in the opening 30 minutes, yet they failed to carve out any clear opportunities.
Ronaldo thought he had given his side the lead 10 minutes before the interval, but his powerful header was ruled out after he had strayed into an offside position.
The Portuguese superstar inexplicably headed wide with the goal at his mercy immediately after the restart, before lashing just over from outside the penalty area.
La Real went ahead in the 58th minute when Mendez powered home from the spot after David Silva’s shot had struck Martinez’s arm.
Erik ten Hag brought on Bruno Fernandes at half-time, and Jadon Sancho and Alejandro Garnacho in the second half, but United were unable to find a way past the visitors’ stubborn backline in the closing stages.
This defeat was United’s first in 19 home matches in the Europa League – a run that started with victory over FC Midtjylland in February 2016.
Meanwhile, it was La Real’s first-ever win against English opponents in Europe at the seventh time of asking.
Both sides return to domestic action on Sunday, with United away to Crystal Palace in the Premier League and La Real visiting Getafe in LaLiga