A late, late show saw Manchester United come from behind and weather a temporary floodlight failure to defeat Sporting Braga 3-1 and qualify for the Champions League knockout phase.
The Portuguese outfit had the better of an insipid first half before taking the lead early in the second after Jonny Evans impeded Custodio inside the box, with Alan converting the resulting spot kick.
Ten minutes after the opening goal, however, the Estadio Municipal de Braga surrendered to darkness as the stadium's generator broke down, causing all but a couple of floodlights to stop working.
A 12-minute delay followed but it took the Red Devils until the closing 10 to find the result they needed to confirm their qualification on the night, with substitute Robin van Persie exploiting an error from goalkeeper Beto to equalise.
Wayne Rooney gave the away side the lead from the penalty spot after he was brought down with five minutes to go before Javier Hernandez added an exclamation mark in stoppage time.
Sir Alex Ferguson, now in his 27th year at the helm, consigned the likes of Van Persie, Ashley Young, Rio Ferdinand and Michael Carrick to the substitute’s bench in the knowledge that one point from the three remaining group stage fixtures would be enough.
But though the visitors were on top of a dull opening 20 minutes with low-risk play and ‘route one’ deliveries, Braga capitalised on the opportunity to take control of the game and enjoyed the better chances going forward.
With 22 on the clock, they signalled their intent when former Premier League winger Hugo Viana launched a fine cross from the left which Eder rose to glance onto the near upright.
Former Porto man Ruben Micael caused problems on more than one occasion with his industrious runs into the danger zone from the middle of the park, while Leandro Salino produced more than one decent delivery from the flanks on the overlap, but outside of a pair of shots straight at David De Gea further serious attempts remained sparse.
But though big chances at the United goal were indeed a luxury, the home side continued to look the keener of the two and with four minutes down in the second period, would find the breakthrough from a dead ball.
Midfielder Custodio burst into the penalty area but soon found himself blocked off on his route by Evans, causing German official Felix Brych to award the penalty.
Alan’s strike from 12 yards was struck with superb power and placement, and Braga were finally ahead.
With 57 minutes on the clock, however, an unexpected delay was forced by the sudden loss of lighting which led to the players retreating to the changing rooms for 12 minutes.
Both after going ahead and upon returning to the field, however, Jose Peseiro’s men were comfortable in soaking up the visitors’ attempts to fight their way back into the match.
That changed with 10 to go, courtesy of a horrific mis-judgment by Beto in rushing out of his area for a raking free-kick upfield which Van Persie was going to collect all day long.
Sensing the opportunity, the prolific Dutchman sent the ball into the exposed Braga goal from distance and as it stood, Ferguson's side were heading to the last 16.
It would get better from there, however, as after Hernandez forced a fine save from point blank range from Beto, Rooney was sent sprawling by Nuno Coelho as he sought to convert the loose ball.
The England striker would get his goal, despatching a similarly-unstoppable effort from the spot, and so would Hernandez as the game entered three minutes of stoppage time.
Antonio Valencia, who spent much of the game at right-back until a knock forced Nani to make way for Rafael, fired in a cross which was stopped on the line by Douglao before the Mexican managed to find the back of the net the second time around.
Four wins from four and eight points above the rest of the Group H field, United now have the luxury of putting the elite European competition on the backburner until February.
MAN OF THE MATCH
Douglao - Braga: Challenge after challenge, block after block and a stoppage time goal-line clearance which ultimately and unfortunately ended up moot, like the rest of the centre-back's rock-like performance.
MATCHCAST: FULL COMMENTARY AND STATS