Colchester United chalked up their first home victory in four months thanks to a late winner from Scott McGleish.
This rollercoaster relegation struggle seemed to be finally heading towards a goalless draw until a dramatic 60 seconds of action.
Mansfield were cursing their luck when left-back Adam Eaton let fly with a 25-yard shot that beat keeper Simon Brown all ends up. However, the rising shot cannoned off the post and fell to safety.
Play immediately switched to the other end where McGleish popped up with what proved to be a vital winner.
Substitute Gareth Williams, on loan from Crystal Palace, had looked very impressive since his introduction as a substitute early in the second half.
It was Williams who set up the chance for McGleish when he ran at the Stags defence before seeing his shot blocked by keeper Keith Welch.
The rebound fell kindly for McGleish, who nodded into an empty net from six yards out to clinch all three points for Colchester.
It was McGleish's sixth goal of the season, and his fifth in the league. The ex-Barnet striker had also hit the back of the net in the previous game at Bristol City.
And McGleish also hit the woodwork earlier in the match against the Stags, with a ferocious drive after 33 minutes which hit the underside of the bar.
Geraint Williams has been the caretaker-manager at Layer Road for three matches since Steve Whitton's departure on January 29 and he has done his chances of landing the job full time no harm at all with an unbeaten run.
Former Derby and Ipswich midfielder Williams, who was Whitton's assistant has helped to edge Colchester out of the bottom four with a draw at Stockport and now wins at Bristol City and against Mansfield.
Williams said: "I would like the job full time, but I don't even know if I'll still be here on Monday. I haven't even had an interview yet."