Manchester City manager Manuel Pellegrini felt his team had rediscovered the winning spirit after snatching a last-gasp victory over Aston Villa.

Fernandinho struck in the 89th minute as City killed off a Villa comeback at the Etihad Stadium to claim a 3-2 Barclays Premier League victory.

City were not at their best but looked to have the game sewn up as they went 2-0 ahead with goals from Sergio Aguero – pouncing on a Brad Guzan blunder – and Aleksandar Kolarov.

But FA Cup finalists Villa quickly replied through Tom Cleverley and looked to have claimed a hard-earned point in their relegation fight through Carlos Sanchez five minutes from time.

City needed to respond and, after with team and Pellegrini under heavy scrutiny following the collapse of their title bid, Fernandinho had the final word.

Pellegrini said: "I don't think it was fortunate.

"We didn't play well and I think Aston Villa played very well, especially in possession of the ball, but they didn't have chances to score, just the two set-pieces (from which) they drew the game.

"So, I don't know why we are fortunate that we scored the third goal from a set-piece in the same way they scored their two goals.

"It is very important to continue with the spirit we had today. It is not easy when you are winning 2-0 and then they draw 2-2 to go again for the match. We did it.

"With this spirit, another game we don't lose."

The victory lifted City into second place – for at least one night – and strengthened their grip on a top-four place.

One downside was an injury to midfielder Yaya Toure, who was feeling his hamstring in the first half and withdrawn at the interval.

Pellegrini said: "It is difficult to know today what will happen but it was not a precaution. It was a muscle injury. We will see tomorrow or Monday how important (an injury) it is."

Villa boss Tim Sherwood felt his side competed well after recovering from their poor start.

City took the lead after just three minutes when Guzan gave the ball straight to Aguero.

Sherwood said: "I thought we came here and performed very well even though we had a poor start.

"We stuck to the plan and I thought we dominated possession, especially in the first period. The pleasing thing was we weren't just passing for the sake of it. We actually opened them up a few times and created chances.

"Brad knows he has made a mistake. It is probably not the first mistake he has ever made but he is a good character and he will get over it.

"We went 2-0 down but came back in the game very quickly. We had real belief we could go on and get something out of the game."

There was controversy soon after the Sanchez equalizer when Christian Benteke was tripped by Joe Hart – only for the Villa striker to be ruled marginally offside.

"It was onside," Sherwood said. "It is a penalty and a sending off."

Villa are now just two points above the bottom three but Sherwood is confident in his players.

He said: "We are running out of games but there are still enough games for us to look after our own destiny."

Mobile app users, watch the video highlights.