Europa League - Group F - Arsenal v Vitoria S.C. - Emirates Stadium, London, Britain. Photograph:( Reuters )
Unai Emery's side were heading for a demoralising defeat but substitute Pepe's late intervention kept the Gunners top of Group F with a maximum nine points.
Nicolas Pepe spared Arsenal's blushes with two sublime free-kicks as they claimed a last-gasp 3-2 win over Vitoria in the Europa League on Thursday having twice trailed.
Unai Emery's side were heading for a demoralising defeat, three days after losing meekly to Sheffield United in the Premier League, but substitute Pepe's late intervention kept the Gunners top of Group F with a maximum nine points.
Vitoria led 2-1 thanks to first-half goals by former Tottenham Hotspur prospect Marcus Edwards and Bruno Duarte either side of Brazilian teenager Gabriel Martinelli's leveller for the hosts -- his fifth goal in only his third start.
The home fans were becoming increasingly restless when Emery sent on Ivorian club-record signing Pepe from the bench in the 75th minute and five minutes later he curled the ball in left-footed from 20 metres after Matteo Guendouzi had been fouled.
He repeated the trick with what turned out to be virtually the last kick of the game to seal a seventh successive home win in Europe for Arsenal.
It was tough on Vitoria who played superbly until tiring late on and despite the win, it was a disjointed display by Arsenal who were booed by their own fans at halftime.
Pepe had only managed one goal in 11 appearances since joining from Lille but his sensational double against Vitoria could be the spark he needed, according to Emery.
"He can gain confidence from tonight. When he scores it's good for him and the team. He's getting better and he helped us tonight to win this match," Emery, who sent on Guendouzi and Dani Ceballos at halftime, said.
"Pepe is a very good player and we believe in him totally. We are very happy for him and us because he has two goals and two set-pieces which are perfect.
"He is improving and tonight he has two goals, which are important for us and for him. We didn't play as we wanted but we showed good spirit. It's a good victory."
Arsenal skipper Hector Bellerin admitted it had been a below-par display.
"There are lots of things we've got to improve as a team. We've got to keep the ball better, that's our trademark," he said. "When you give the ball away it doesn't mean you stop playing like that, it's in our DNA."
Until Pepe's dramatic arrival the headlines looked set to be about London-born Edwards, a player Spurs manager Mauricio Pochettino once described as having a playing style similar to Argentine great Lionel Messi.
The tricky 20-year-old made only one League Cup appearance for Tottenham, however, and moved to the northern Portuguese club in the close season after a loan spell at Dutch side Excelsior.
He twisted inside two Arsenal defenders to fire his side ahead in the ninth minute -- celebrating in front of the home fans. He remained lively throughout until eventually being substituted with his side still leading.