Crystal Palace scored three times in the last ten minutes to inflict Brighton's first ever league defeat at the Amex Stadium.
Craig Mackail-Smith gave the home side an early lead when he turned home from Gary Dicker's cross.
Palace began to dominate the second half and pulled one back through Wilfred Zaha in the 80th minute.
Prolific midfielder Darren Ambrose then put the Eagles in front with just a minute of normal time remaining, after combining with Jonathan Parr.
Former Brighton striker Glenn Whealen clinched the win with Palace's third in stoppage time.
The result moved Palace up to ninth in the Championship and prevented Brighton from going top of the table in the process.