Cambridge twice came from behind to grab a 3-2 win that leaves opponents Chesterfield deep in relegation trouble.
The home side led after 38 seconds but mistakes cost them again as they slumped to a third consecutive home defeat.
Chesterfield made a sensational start when excellent work from Chris O'Grady set up Joe Rowley, although defender Harrison Dunk may have got the unwanted final touch.
But Cambridge equalised in the 19th minute after Aaron Ramsdale fumbled a shot and Jevani Brown's cross was turned in by Alex Whitmore.
Louis Dodds had a shot saved by David Forde but the keeper was helpless as Chesterfield regained the lead in the 55th minute.
Rowley played Robbie Weir in down the left and his cross was headed in by Kristian Dennis from 12 yards, but Cambridge hit back when Weir fouled Billy Waters and Uche Ikpeazu converted the 68th-minute penalty.
Cambridge completed the comeback in stoppage time when a corner dropped to Dunk, who fired into the roof of the net.