Roger Federer came from two sets to one down to survive a Wimbledon scare from Adrian Mannarino, who was forced to retire after suffering a knee injury.

Federer was expected to come through his first match at the All England Club since losing the 2019 final to Novak Djokovic with little difficulty.

That anticipation was increased when he claimed the first set, only for Mannarino to fuel hope of a first win over Federer in their seventh meeting by taking the next two sets.

The 20-time grand slam champion had re-established a measure of control in the fourth set when Mannarino was left in agony after his knee buckled at 4-2.

Mannarino attempted to continue but conceded the injury was too much to overcome in the opening game of the fifth with the score 6-4 6-7 (3-7) 3-6 6-2.

Federer lost just five points on serve in taking the opener, though he took only one of his six break points, with Mannarino proving a significantly tougher nut to crack in the second set.

The Frenchman did not face a break point and was surprisingly dominant in the tie-break, and he carried that confidence into the third, making six unforced errors to Federer's 10.

At that point, the biggest shock of the tournament looked to be on the cards, but Federer was back to his best in the fourth.

Imperious at the net, Federer hit 18 winners in the fourth and a decider already looked an inevitability by the time Mannarino's misfortune meant the Swiss could save energy before a second-round clash with either Richard Gasquet or Yuichi Sugita.