Manchester City lost for the first time since April as they came unstuck against Shakhtar Donetsk in the Champions League on Wednesday, but Pep Guardiola believes it will ultimately prove to be a good thing for his swashbuckling side.

A much-changed City side were beaten 2-1 by the impressive Ukrainian champions in freezing conditions at the Metalist Stadium in Kharkiv.

The result was actually of little significance for City, having already secured top spot in Group F, but it was hardly ideal preparation for Sunday's derby against Manchester United at Old Trafford.

Goals in quick succession from two of Shakhtar's Brazilians, Bernard and Ismaily, midway through the first half proved City's undoing, with Sergio Aguero's injury-time penalty providing consolation only.

The defeat ended City's club record run of 20 successive wins and was also their first defeat in 29 games since April's FA Cup semi-final loss to Arsenal.

Guardiola insisted his team will emerge stronger for the experience.

The former Barcelona boss, who made seven changes, said: "It hurts. It is never nice to lose a game.

"But we have said many times we cannot win all the time, we are going to lose games. We needed to lose a game.

"It will be good for the club, for all of us and the media. People say things when you win a lot and you can forget that now.

"We saw many good things but we made mistakes and we are going to improve on that. Football is how you recover in the good moments and bad moments to stay stable."

Guardiola handed opportunities to 17-year-old Phil Foden, who made his full debut, and 20-year-old defender Tosin Adarabioyo. Brahim Diaz, 18, also appeared as a second-half substitute.

Guardiola said: "We played to win until the end. We did a good performance and young players like Tosin (Adarabioyo), Phil (Foden), Brahim (Diaz) played really well.

"Players like Yaya (Toure) and (Ilkay) Gundogan made a good performance as well and Bernardo (Silva) was brilliant. We created chances. Now it's about recovery and preparing for the next game."

There was some fun after the game as Shakhtar coach Paulo Fonseca, who was recently linked with Everton, fulfilled a promise to hold a press conference dressed as Zorro if his team reached the last 16.

Shakhtar's victory secured second place in the group and Fonseca donned the black hat, mask and cape of the swashbuckling fictional character to perform media duties.

"This is the most joyful press conference of my career," the Portuguese said.

Reflecting on his side's performance, he said: "We played an almost ideal game. I feel great joy.

"I think not only Shakhtar's supporters but all Ukrainians have to be proud of our team. Twelve points in such a group is fantastic."