North End grabbed all three points with a last ditch winner at Deepdale.
Eoin Doyle had equalised Tony Andreu’s first half headed opener, but the drama happened in the final minute of stoppage time as Marnick Vermijl’s huge throw from the left hand side was flicked into the top right hand corner of the goal by Jonson Clarke-Harris to give the Lilywhites a deserved three points after a superb second half display.
Andreu headed home Danny Ward’s left wing cross ten minutes before the break to give the Millers the lead only for Doyle to poke home Paul Huntington's flick on; before the late winner.
North End were forced into two changes from the side that defeated Hull City on Bank Holiday Monday, Jordan Pickford and Will Keane both recalled to their parent clubs, and were replaced by new loan signing Sam Johnstone and Irish striker Eoin Doyle.
The visitors, who made just one change with new signing Shay Facey coming in at right back, started brightly and Danny Ward found himself through, running onto Kirk Broadfoot’s low ball; the forward rounded Sam Johnstone, but Bailey Wright cleared off the line for a corner, hitting the post in the process, causing an injury that would force him off at half-time.
North End’s first chance came on the 20 minute mark as a Greg Cunningham's cross from the left was flicked just over the bar from 12 yards out by Doyle.
The visitors had the lead ten minutes before the break. Danny Ward racing down the left hand side and delivered a cross to the back post where Tony Andreu met the ball to head past Johnstone into the bottom left corner of the goal.
There was almost an immediate reaction from Simon Grayson's side as Joe Garner picked up the ball from Daniel Johnson’s cross; he did brilliantly to check inside, but an excellent block by Kirk Broadfoot and follow up block to prevent Adam Reach getting in on goal prevented an equaliser.
North End thought they had the ball over the line on 54 minutes when Gallagher’s ball into the box was headed goalwards by Garner and the ball seemed over the line, however, the referee, Charles Breakspear, waved play on.
From the resulting corner Huntington, the interval introduction for the injured Wright, met Gallagher’s corner and it was heading for the top corner until Lee Camp’s flying intervention turned it behind.
It was all North End in the second period and Camp brilliantly denied Alan Browne’s acrobatic effort, before Garner flicked a header just wide of the right hand post, both efforts coming from excellent deliveries by Gallagher on the left hand side - the switch of the No.12 onto the flank one of the major reasons for the change in flow of the game.
And the equaliser, which was certainly deserved on the second half display came on 64 minutes as another Gallagher free kick was flicked on by Huntington and Doyle nudged the ball home at the back post, much to the delight of the home faithful.
The home side were now advancing at will and almost had the lead less than a minute later as yet another great Gallagher cross found Garner at the back post, but Camp did superbly to come out and block.
And it perhaps should have been two at the mid-point of the half, yet another wonderful save from Camp, this time denying Doyle from Cunningham’s left wing cross to the striker 12 yards out. It was a powerful header and a brilliant instinctive block on the line by the former Derby stopper.
Yet another flashing header, this time from Alan Browne was inches past the left hand upright from Adam Reach’s inswinging corner from the right after Garner’s work rate had won yet another opportunity to cross.
With two minutes to go a Gallagher free kick was palmed away by Camp, diving at full stretch to his right and then Reach was inches away from finding Garner free in the box, only for an outstretched boot of Broadfoot preventing the chance and it looked like PNE would have to settle for a point.
However, there was three minutes of added time signalled. Those 180 seconds seemed to have all run out when manager Simon Grayson through his centre backs into the box and called Marnick Vermijl across to the left to take a long throw.
The Belgian threw a huge ball into the six yard box which flicked off the head of Jonson Clarke-Harris and flew into the top right hand corner of the goal to lift Deepdale off its seats – nothing more than the Lilywhites deserved for a fantastic second half display.
PNE line-up: Johnstone, Vermijl, Cunningham, Welsh (Browne, 53), Clarke (c), Wright (Huntington, 46), Doyle (Hugill, 81), Gallagher, Garner, Johnson, Reach. Subs not used: Kirkland, Kilkenny, Woods, Brownhill.
Rotherham United line-up: Camp, Mattock, Broadfoot, Frecklington (c) (Green, 11), D Ward, G Ward, Rawson (D Collins, 83), Newell, Andreu (Clarke-Harris, 59), Facey, Smallwood. Subs not used: Collin, Wood, Ledesma, Derbyshire.
Attendance: 12,027 (1,038 away fans)
Referee: Mr C Breakspear