Nicolas Pepe salvaged a fortuitous Europa League win for Arsenal as Unai Emery's side twice came from behind to overcome Vitoria SC 3-2.
Heading into Thursday's Group F meeting on the back of six successive home wins in European competition, Arsenal was well below par on Thursday, but substitute Pepe stepped up with a late double.
The result was far more than Arsenal were worth, with Vitoria - which took the lead through ex-Tottenham youngster Marcus Edwards early on - having crafted some excellent opportunities.
Gabriel Martinelli's equaliser had brightened Arsenal's prospects midway through the first half, though the Brazilian's header was swiftly cancelled out by Bruno Duarte.
But it was the much-maligned Pepe who had the final say with two devastating free-kicks - his second a spectacular effort in stoppage time which clinched the points.
Arsenal was on the back foot from the off and, after Andre Almeida had drilled at Emiliano Martinez, was behind when Edwards coolly slotted home.
Emery's side might have been two down had Denis Poha kept his composure, but Vitoria was made to pay for his miss when indecision from goalkeeper Miguel Silva allowed Martinelli to head into a gaping net.
Parity was short-lived, however - Bruno hammering home on the rebound after Davidson had hit the post following Ainsley Maitland-Niles' error.
Davidson went close again prior to the interval, with the winger crafting another opening after the restart, but Poha's backheel did not get the better of Bernd Leno.
The ineffective Alexandre Lacazette was replaced by Pepe as Emery rolled the dice, and the change paid dividends within five minutes.
Silva was to blame, his dreadful positioning meaning he was unable to get over to Pepe's curling 80th-minute set-piece, which nestled in the bottom-left corner.
He then made a fine save to deny Rob Holding but could do little to prevent Pepe's winner, as the former Lille star picked out the top-left corner with a sensational strike.
What does it mean? Emery gets lucky
Though Arsenal sits fifth in the Premier League and top of its Europa League group with nine points, it is hard to feel its failings under Emery have not simply been masked by Pierre-Emerick Aubameyang's goals.
It was Pepe who came to its rescue on Thursday, but if the standard of Arsenal's displays do not improve, Emery's prospects of staying on at Emirates Stadium look rather bleak.
Pepe comes to the fore
It has been a long time coming, but Arsenal's record signing may have finally found his feet.
Despite having scored from the spot in a Premier League win over Aston Villa, Pepe's chronic lack of confidence in front of goal had been a huge issue. Thursday's sensational cameo might just spark his Arsenal career.
Maitland-Niles' midfield mare
Deployed in his preferred role in midfield, Maitland-Niles endured a difficult first half, much of which he spent tracking Davidson back down Arsenal's right flank before his mistake gifted Guimaraes their second.
He was duly taken off at half-time, though Mesut Ozil was again not included among Emery's options to replace him from the bench.
Crystal Palace is next up for Arsenal in the Premier League, while Vitoria faces a trip to Lisbon to play Sporting CP.