Substitute Scott McTominay scored a stoppage-time winner as Manchester United kept alive their hopes of qualifying as group winners in the Europa League with victory over Omonia Nicosia.
McTominay, introduced with less than 10 minutes remaining, fired in the winner after fellow substitute Jadon Sancho teed him up in the box.
The result means United remain three points behind Group E leaders Real Sociedad, who beat Sheriff Tiraspol for their fourth win in as many matches in the competition.
Erik ten Hag's side dominated and had several huge chances to score but were left frustrated until McTominay's winner.
Omonia goalkeeper Francis Uzoho was undoubtedly the visitors' best performer as he kept out 11 of United's 12 shots on target.
But he could do nothing to stop McTominay's strike in the 93rd minute, having saved three big chances for Marcus Rashford in the first half.
Casemiro, who started in midfield alongside Fred, struck the crossbar in the first half too, before Fred headed over the bar from an unmarked position in the box.
Cristiano Ronaldo could not take his chances either and McTominay had smashed a wild shot into the stands before finding the composure to score the winner in front of an elated Old Trafford crowd.
Omonia, who had few opportunities at the other end, could have scored themselves on the stroke of half-time but Bruno Felipe did not square it for team-mate Andronikos Kakoullis who was completely free in the middle.
Neil Lennon's side, who went 1-0 up in the reverse fixture last week before Rashford's double helped United claim a 3-2 win, were cheered on by 4,500 visiting fans and they were minutes away from an impressive result.
Victory means United's hopes of topping the group remains within their grasp. They face Sheriff Tiraspol at home in their next match on 27 October.
United's efforts eventually pay off
Ten Hag noted the positive reactions of his players to setbacks in his pre-match programme notes and they were tested again on a largely frustrating evening at Old Trafford.
It looked like United were going to rue the missed chances as full-time approached but they were building pressure. When the fourth official showed five added minutes on the board, a roar inside Old Trafford suggested the belief remained that they would eventually find a winner.
McTominay, who replaced Casemiro after 81 minutes, was in the right place to collect Sancho's pass after neat footwork from the winger on the left.
The Scotland midfielder took one touch before firing it past Uzoho, who minutes earlier must have thought he was heading home to a heroes' welcome in Cyprus for his outstanding performance.
While there will still be concerns for Ten Hag as his side clearly lacked ruthlessness, the result means they have now won three games in a row since the 6-3 humbling at Manchester City.
Player of the match
PapoulisFotios Papoulis
Omonia Nicosia
Squad number13Player namePapoulis
Squad number10Player nameLoizou
Squad number23Player nameUzoho
Squad number18Player nameAnsarifard
Squad number2Player namePsaltis
Squad number76Player nameCharalampous
Squad number22Player nameLang
Squad number14Player nameKitsos
Squad number6Player nameYuste
Squad number3Player nameMatthews
Squad number73Player nameMiletic
Squad number42Player nameDiskerud
Squad number80Player nameKakoulli
Squad number30Player namePanagiotou
Squad number7Player nameBruno Felipe
Squad number8Player nameMoreto Cassamá
Line-ups
Man Utd
Formation 4-2-3-1
1de Gea
20Dalot2Lindelöf6Martínez12Malacia
18Casemiro17Fred
21dos Santos8Bruno Fernandes10Rashford
7Cristiano Ronaldo
1de Gea20Dalot2Lindelöf6Martínez12MalaciaSubstituted forShawat 60'minutes18CasemiroSubstituted forMcTominayat 81'minutes17FredSubstituted forEriksenat 70'minutes21dos SantosSubstituted forSanchoat 60'minutes8Bruno Fernandes10Rashford7Cristiano RonaldoSubstitutes
14Eriksen19Varane22Heaton23Shaw25Sancho28Pellistri31Dúbravka36Elanga39McTominay49Garnacho55IqbalOmonia Nicosia
Formation 5-3-2
23Uzoho
3Matthews73Miletic6Yuste22Lang14Kitsos
76Charalampous8Moro Cassamá30Panagiotou
80Kakoulli7Souza da Silva
23Uzoho3MatthewsSubstituted forPsaltisat 65'minutes73Miletic6Yuste22Lang14Kitsos76CharalampousSubstituted forPapoulisat 74'minutes8Moro CassamáBooked at 68minsSubstituted forDiskerudat 86'minutes30PanagiotouBooked at 90mins80KakoulliBooked at 49minsSubstituted forAnsarifardat 64'minutes7Souza da SilvaSubstituted forLoizouat 74'minutesSubstitutes
1Panayi2Psaltis10Loizou11Barker13Papoulis17Lecjaks18Ansarifard20Zachariou42Diskerud78Venizelos79Savva90BezusLive Text
Match ends, Manchester United 1, Omonia Nicosia 0.
Second Half ends, Manchester United 1, Omonia Nicosia 0.
Foul by Marcus Rashford (Manchester United).
Nikolas Panagiotou (Omonia Nicosia) wins a free kick in the defensive half.
Attempt missed. Héctor Yuste (Omonia Nicosia) right footed shot from outside the box is too high.
Goal! Manchester United 1, Omonia Nicosia 0. Scott McTominay (Manchester United) right footed shot from the centre of the box to the bottom left corner.
Attempt blocked. Jadon Sancho (Manchester United) right footed shot from the left side of the box is blocked. Assisted by Christian Eriksen.
Nikolas Panagiotou (Omonia Nicosia) is shown the yellow card for a bad foul.
Marcus Rashford (Manchester United) wins a free kick in the attacking half.
Foul by Nikolas Panagiotou (Omonia Nicosia).
Attempt missed. Scott McTominay (Manchester United) right footed shot from outside the box is too high. Assisted by Lisandro Martínez.
Corner, Manchester United. Conceded by Nikolas Panagiotou.
Marcus Rashford (Manchester United) wins a free kick in the attacking half.
Foul by Nikolas Panagiotou (Omonia Nicosia).
Substitution, Omonia Nicosia. Mikkel Diskerud replaces Moreto Cassamá.
Foul by Scott McTominay (Manchester United).
Nikolas Panagiotou (Omonia Nicosia) wins a free kick in the defensive half.
Attempt saved. Scott McTominay (Manchester United) right footed shot from outside the box is saved in the bottom right corner. Assisted by Bruno Fernandes.
Substitution, Manchester United. Scott McTominay replaces Casemiro.
Attempt missed. Bruno Fernandes (Manchester United) right footed shot from the centre of the box is high and wide to the right. Assisted by Casemiro.