Manchester City suffered their first home Premier League loss in eight months as a shock 3-2 defeat to Crystal Palace on Saturday left Pep Guardiola's champions trailing leaders Liverpool by four points.

City, who had won all nine home games in the league this season, are in second place on 44 points with Liverpool, who won 2-0 at Wolves on Friday, at 48.

Two defeats in three games for City, who lost at Chelsea a fortnight ago, have given Jurgen Klopp's Liverpool the upper hand in the title race and turned the Jan. 3 clash between the sides at the Etihad into a real showdown.

City, sorely missing injured midfielder David Silva, looked ragged and panicked at times, but Palace and manager Roy Hodgson produced a magnificent performance, which included a brilliant goal by Andros Townsend.

Many teams better than Palace have been unable to find the recipe for beating Guardiola's men, but the London side took their chances and defended resiliently to secure a victory that belies their 14th place in the table.

A dejected Gabriel Jesus looks on during Man City's surprise defeat to Crystal Palace. Robbie Jay Barratt - AMA/Getty Images

"Obviously, the result is a setback. We have lost, but we are only looking at ourselves game to game," said City captain Fabian Delph. "We had a few chances which we have put away in the past, but fair play to Crystal Palace -- they were stubborn and organised.

"It's hard to analyse, and we will go back to the drawing board and look at it."

It seemed to be business as usual for City after German midfielder Ilkay Gundogan nodded them in front in the 27th minute, meeting a Delph cross from deep with a firm, downward header.

But Jeffrey Schlupp brought Palace level with a low diagonal shot into the bottom corner, and Townsend stunned the Etihad Stadium with a sensational volley that will be a goal-of-the-season contender.

Bernardo Silva's header out was met first time by Townsend, who blasted his volley from 30 metres past Ederson. The helpless City keeper could do nothing about the perfect combination of technique and power from the former Spurs and Newcastle player.

"It sat up perfectly for me. I knew I couldn't take a touch as City would have been on me and on the counter, and as soon as it left my foot, I knew it had a good chance," Townsend said. "It's definitely the best goal of my career, against the best side I've ever played."

The air of surprise at the Etihad turned to panic in the 51st minute when Palace went 3-1 up through a Luka Milivojevic penalty after Kyle Walker brought down Max Meyer with a wild challenge.

Guardiola brought on substitutes Sergio Aguero and Kevin De Bruyne, and the Belgian midfielder gave the home side hope with a cross-shot in the 85th minute that caught out Palace keeper Vicente Guaita.

Gabriel Jesus missed a stoppage-time chance when he headed over a De Bruyne cross from a promising position, but City were left to taste their first home league loss since the Manchester derby on April 7.

Roy Hodgson's Palace had picked up just one point from their past six away games and had not won at City since 1990.