Mansfield winger CJ Hamilton settled a bad-tempered game with a 94th-minute winner against nine-man Cheltenham.
Hamilton scored his second and crucial goal at the death with a rising shot from six yards after Mal Benning's shot had been blocked.
Cheltenham's afternoon began well as they took a 24th-minute lead from the spot through Harry Pell after Hayden White had upended Mohamed Eisa.
But the Stags were level when Hamilton turned home a low Alfie Potter cross from close range.
The visitors were reduced to 10 men with 41 minutes gone after Taylor Moore was dismissed for an elbow across the face of Danny Rose.
Cheltenham boss Gary Johnson was then sent to the stands after he and home assistant boss Paul Raynor had squared up.
The visitors then lost top scorer Eisa on a stretcher after he had stayed down following a tackle by Krystian Pearce, all the incidents resulting in 12 minutes of first-half stoppage-time.
The sides were evened up after 68 minutes when White was dismissed for his two-footed lunge at Ilias Chatzitheodoridis.
And Cheltenham were back ahead when Danny Wright set up Elijah Adebayo for a superb rising finish at the near post.
But Mansfield sub Kane Hemmings levelled it three minutes after coming on, with a close-range finish after good work from Alex MacDonald.
Cheltenham ended the game with nine men after Wright hit Potter on the back of the head to earn an 83rd-minute red card before Hamilton secured the points with his late winner.
Match report supplied by the Press Association