Ryan Cresswell headed home an injury-time winner to clinch a 3-2 victory for Rotherham against 10-man Accrington in an ill-tempered clash.
Stanley went ahead after nine minutes when Dean Winnard fed Andy Parkinson on the left-hand side of the area and he took the ball past keeper Andy Warrington to fired low into the far corner of the net.
But defender Kevin Long, signed on loan from Burnley on Friday, was dismissed in the 17th minute when he brought down last man Adam Le Fondre.
The dispute was whether it was inside the area but referee Geoff Eltringham gave the penalty and Le Fondre fired home his 11th goal of the season.
Stanley keeper Ian Dunbavin then kept Rotherham at bay as he denied Kevin Ellison in a one-on-one and dived low to keep out a Tom Pope header.
Dunbavin again kept out Le Fondre and an Ellison follow-up while Luke Joyce cleared Le Fondre's overhead kick off the line in a lively first half.
However it was 10-man Stanley who regained the lead in the 49th minute when a Sean McConville corner was dummied by Phil Edwards and it fell to Jimmy Ryan on the edge of the box and he rifled the ball low into the net.
After that it was the Millers' attack against Stanley's defence in a game which had several flash points.
With nine minutes to go, a Paul Warne corner was headed home by tall defender Exodus Geohaghon for the equaliser.
Substitute Ryan Taylor hit the post before, from Geohaghon's long throw in the 92nd minute, Cresswell headed home to end Stanley's unbeaten home record.
Copyright (c) PA Sport 2009, All Rights Reserved.