Villarreal have a slight advantage going into next week’s second leg against Arsenal at The Emirates.
The first leg of this semi-final clash appeared to be getting away from the Gunners as first-half goals from Manuel Trigueros and Raul Albiol preceded a Dani Ceballos red card just before the hour.
But Pepe would convert from the spot to send Arsenal home with a 2-1 deficit, Villarreal having also been reduced to 10 men late on following the dismissal of former Tottenham man Etienne Capoue.
This is Arsenal’s third Europa League semi-final in four years but they have only made the final once in that time – under current Villarreal boss Unai Emery, who looked to be getting one over his former club as the hosts made a flying start.
Trigueros opened the scoring with just five minutes on the clock, driving home a low effort after indecision in the Arsenal box allowed Samuel Chukwueze to play in his team-mate.
Mikel Arteta was left ashen-faced as the lead was doubled before the half-hour, Albiol turning home at the back post as Arsenal failed to get anywhere near to a routine corner.
Pepe thought he had won a penalty after he was tripped inside the box but a VAR review deemed he had handled the ball in the build-up and the award was overturned.
The visitors failed to have a shot on target in the first half and could have been further behind if Bernd Leno had not made a fine stop to deny in-form Gerard Moreno.
But a red card for Ceballos, who was lucky not to pick up a second booking early in the second half, for standing on Dani Parejo looked to have Arteta’s men staring at elimination.
Instead they rallied and gave themselves hope of overturning the aggregate score next week at the Emirates Stadium.
Bukayo Saka broke into the Villarreal box and was caught by Trigueros, allowing Pepe to coolly slot home the resulting penalty.
When Capoue was then shown a second yellow card 10 minutes from time as he was taken off on a stretcher after fouling Saka, Arsenal even harboured hopes of an equaliser.
That was not to be, despite a late chance for returning captain Pierre-Emerick Aubameyang but – given how the evening started – Arteta and his players will be pleased to still have a good chance of advancing to the final in Gdansk.