Bruno Fernandes converted a penalty deep into added time as Manchester United clinched a tense 3-2 win following an incident-packed clash at Brighton & Hove Albion.
Fernandes converted from 12 yards with the last kick of the game after referee Chris Kavanagh penalised Neal Maupay for handball having consulted the pitchside monitor.
Solly March appeared to have earned Brighton the point by heading home five minutes earlier to cancel out Marcus Rashford's solo effort.
But, after Kavanagh initially seemed to have blown the full-time whistle, Fernandes had the final say.
A Lewis Dunk own goal had levelled Maupay's cheeky opener from the penalty spot just before the break.
United, who struggled to impress and were second best for much of the afternoon, also had two goals disallowed, while the Seagulls struck the woodwork five times and had another spot-kick award overturned following a VAR review.
United manager Ole Gunnar Solskjaer was happy to admit his side had ridden their luck.
"We got away with one. Maybe one point we deserved, we didn't deserve more. But the character deserved more," he said.
"Last season we had too many draws, so that is a big plus for us."
Brighton boss Graham Potter could not believe his team lost after creating so many chances and drawing level so late.
"It's a sore one, to say the least. Sometimes life isn't fair and it feels like that at the moment," he said.
"All the little things have gone against us but we were really good for 90 minutes and we have to take that forwards. We deserved something from the game to say the least."
Solskjaer brought in Aaron Wan-Bissaka , Nemanja Matic and Mason Greenwood, while keeping faith with under-fire defender Victor Lindelof.
After the unexpected loss to Palace, the 20-time English champions were bidding to avoid suffering successive defeats at the start of a Premier League season for the first time in 28 years.
That unwanted statistic looked likely to materialise when Leandro Trossard struck both posts from the edge of the box and Brighton team-mate Adam Webster headed against the crossbar inside the opening half an hour.
The recalled Greenwood later had an effort ruled out for offside against Rashford in the build up, before Albion striker Maupay opened the scoring with his third goal in two games.
The Frenchman, who registered a brace at Newcastle last weekend, dinked home from 12 yards after Fernandes was penalised for a challenge on Tariq Lamptey.
Having secured the advantage their display merited, the Seagulls surrendered it just 194 seconds later to go in level at the break.
Fernandes' free-kick from the left was turned across goal by Matic before Dunk, under pressure from Harry Maguire, diverted in the fifth Premier League goal of his career.
With the equaliser being credited to Dunk, United's first attempt on goal eventually arrived in the 44th minute when Matic's drive from distance flew straight at Ryan.
Brighton, buoyed by three successive wins without conceding in league and Carabao Cup, were playing with confidence.
However, Rashford put United 2-1 up with a fine individual effort.
After collecting the ball from Fernandes, he danced around the Seagulls defence before an emphatic finish.
Brighton were far from beaten. March saw a low effort rebound off the inside of the right post, before Trossard completed a hat-trick of sorts by thumping against the bar.
United looked to have survived the pressure before the unmarked March sparked wild celebrations by nodding in from close range.
However, there was a late twist in the tale.
Players from both teams surrounded match official Kavanagh during a remarkable ending to the game which culminated in Fernandes' calm spot-kick after Maguire headed against the outstretched arm of Maupay.
Amid the melee, the Portugal international was the calmest man in the stadium as he duly dispatched the ball high into the top-right corner to cap a crazy encounter.