Match ends, Crystal Palace 3, Brighton and Hove Albion 2.
Crystal Palace manager Roy Hodgson said his side "did it the hard way" by winning a five-goal thriller against Brighton to move six points clear of the Premier League relegation zone.
In the opening 34 minutes, Palace scored three goals in a scintillating attacking display but twice conceded their two-goal lead.
"I thought our first half performance was very commanding but I was disappointed we conceded those two goals," Hodgson said.
"In the second half Brighton put us under more pressure and we weren't able to reproduce our level in terms of our attacking play so it meant we had to spend the last 15 minutes fighting to keep balls out of our box.
"We did it the easy way in the first half but the hard way in the second."
The excellent Wilfried Zaha opened the scoring in the fifth minute by tapping in on the goal line after Mat Ryan had saved Luka Milivojevic's shot.
A rampant Palace scored a second nine minutes later when James Tomkins scrambled the ball home at a corner but Glenn Murray halved Brighton's deficit, hooking the ball in via the crossbar after Lewis Dunk had headed towards goal at another corner.
Zaha capitalised on more poor Brighton defending to head in his second from Milivojevic's lofted cross in the 24th minute, only for the visitors to again pull a goal back 10 minutes later when Jose Izquierdo calmly finished across Wayne Hennessey.
Palace tired in the second half and rode there luck when Glenn Murray missed a straight-forward chance in stoppage time by failing to volley in Solly March's cross from three yards.
However, Hodsgon's side held on for a win which moves them up to 16th in the table, while Brighton are 13th with one point more than Palace and, with a difficult run-in to come, are still at risk of relegation.
Thrilling game and a huge three points
Palace started the game in ferocious fashion, not looking like a team who had won only one of their previous seven home matches.
They surged forward with pace through Zaha and Andros Townsend and Milivojevic sprayed passes in midfield and won the ball back powerfully.
Hodgson's side capitalised on poor defending for all three goals but each was reward for the intent they showed in the opening half.
The Eagles suffered as a result of that blistering start in the late stages but they held out thanks to the commanding Hennessey in goal, an excellent block from Mamadou Sakho to deny Glenn Murray and the striker's late miss.
"They put pressure on us, got it in the box, got men forward," Hodgson said. "Luckily for us Wayne Hennessey had an outstanding game so when crosses eluded our defenders he was there."
Palace dropped into the bottom three briefly during Saturday when Southampton led Chelsea 2-0 at St Mary's but the Blues' late-comeback and their own win means the gap to the 18th-placed Saints is six points.
That cushion is even more remarkable given the fact the south London club had no points and had not scored a goal after seven games of the season.
They now have a gap between themselves and the relegation zone and one thing many of their rivals do not, a serious attacking threat.
"We clung on and it was a very important victory," Hodgson said. "It keeps us in, with four games to go, a chance of maintaining our Premier League status.
"Stoke and Southampton have got a game in hand, if they win the games the gap will be a lot less but the teams above us will have to start looking over their shoulders soon."
Defending and run-in leaves Brighton worried
If Palace's start was the perfect one in a game between two rivals, Brighton's was the opposite.
After 14 minutes they were behind to two set-piece goals. First they did not track Milivojevic and allowed him to carry the ball into the area after a short corner and then they failed to clear another corner before Tomkins scrambled the ball home.
Murray pulled Brighton back into the game with his smart finish but defending again cost the visitors when Ezequiel Schelotto let Zaha to head in unchallenged at the back post to restore Palace's lead.
"They were three poor goals from our point of view," manager Chris Hughton. "What we will do is talk about the second half and the fact we gave ourselves a chance but it's almost impossible to turn it around when you give away the goals we gave away."
Brighton moved into 10th place when they beat Arsenal on 4 March but have since only collected one point from four games.
They have a game in hand over their relegation rivals and a seven-point gap but their remaining five games are all against teams in the top seven.
The Seagulls have home games against Spurs and Manchester United to come and also have to travel to Burnley, Manchester City and Liverpool.
"We knew we had a difficult run in and knew we would have to get a result that nobody expected us to be able to get," Hughton said."
"We've put ourselves in this position and it's down to us to get those points."
You can't defend like that and expect points' - analysis
Former Newcastle defender Alan Shearer on Match of the Day: "You can't expect to take points from a Premier League game defending like Brighton did in the first half.
"They have conceded more set-piece goals than anyone in the league.
"Palace didn't play with a centre-forward and Brighton didn't know who to mark. Wilfried Zaha was excellent and everything they did well went through him.
"For his goal he started the move, nobody was tight on him, then it was a brilliant ball in and again nobody was picking him up. He darts in and it was a hell of a header.
"Zaha and Andros Townsend did all their good work down the left."
Man of the match- Wilfried Zaha
Zaha's headed first - the best stats
- Crystal Palace ended a run of four top-flight home games without a victory (D1 L3), netting three goals in a league game at Selhurst Park for the first time since May 2017 (4-0 v Hull).
- Brighton have conceded in each of the past 12 Premier League games - the longest current run without a clean sheet in the division.
- This game saw five first-half goals, the most in any Premier League game this season.
- Wilfried Zaha has scored in consecutive Premier League games for the first time since March 2015 (v QPR and Stoke).
- In completing his first-ever Premier League double, Zaha netted his first-ever headed goal in the competition.
- Zaha has now bagged five goals against Brighton in all competitions, more than he has managed against any other side, with four of those goals coming in his last three against the Seagulls.
- Brighton have conceded 14 goals from corner situations this season, more than any other side.
- Glenn Murray has scored three goals in the past two league meetings between these two sides in the league at Selhurst Park (excl. play-offs), scoring twice in a 3-0 win for Palace in December 2012.
- Murray is the fifth player to score against Crystal Palace in the Premier League having previously played for them in the competition, and the first since Leon McKenzie in April 2005 (for Norwich).
Palace's next match sees them travel to Vicarage Road to play Watford next Saturday (15:00 BST kick-off). Brighton have their game in hand on Tuesday at home against Tottenham (19:45 BST).
- 13HennesseyBooked at 89mins
- 3van Aanholt
- 7CabayeSubstituted forBentekeat 71'minutes
- 4MilivojevicBooked at 16mins
- 8Loftus-CheekSubstituted forRiedewaldat 80'minutes
- 11ZahaBooked at 79mins
- 3BongSubstituted forMarchat 86'minutes
- 13GroßSubstituted forUlloaat 71'minutes
- 7KayalBooked at 90mins
- 6StephensBooked at 11mins
- 25LocadiaSubstituted forKnockaertat 45'minutes
- Andre Marriner
- Shots on Target
Second Half ends, Crystal Palace 3, Brighton and Hove Albion 2.
Beram Kayal (Brighton and Hove Albion) is shown the yellow card for a bad foul.
Foul by Beram Kayal (Brighton and Hove Albion).
Wilfried Zaha (Crystal Palace) wins a free kick on the left wing.
Attempt missed. Wilfried Zaha (Crystal Palace) right footed shot from the centre of the box is just a bit too high. Assisted by Christian Benteke following a fast break.
Attempt missed. Leonardo Ulloa (Brighton and Hove Albion) header from the centre of the box misses to the right. Assisted by Beram Kayal with a cross.
Wayne Hennessey (Crystal Palace) is shown the yellow card.
Attempt missed. Shane Duffy (Brighton and Hove Albion) header from the centre of the box is too high. Assisted by Solly March with a cross following a corner.
Corner, Brighton and Hove Albion. Conceded by Andros Townsend.
Andros Townsend (Crystal Palace) wins a free kick in the defensive half.
Foul by Lewis Dunk (Brighton and Hove Albion).
Substitution, Brighton and Hove Albion. Solly March replaces Gaëtan Bong.
Hand ball by Christian Benteke (Crystal Palace).
Attempt missed. Shane Duffy (Brighton and Hove Albion) header from the centre of the box misses to the right. Assisted by Anthony Knockaert with a cross following a corner.
Corner, Brighton and Hove Albion. Conceded by Joel Ward.
Attempt saved. Dale Stephens (Brighton and Hove Albion) right footed shot from outside the box is saved in the bottom left corner.
Substitution, Crystal Palace. Jairo Riedewald replaces Ruben Loftus-Cheek.
Wilfried Zaha (Crystal Palace) is shown the yellow card.
Foul by Wilfried Zaha (Crystal Palace).