Match ends, Rotherham United 2, Preston North End 1.
Rotherham won for just the second time since the middle of September as they held on to beat Preston and moved out of the Championship relegation zone.
Will Vaulks' spectacular free-kick gave the Millers the lead in first-half stoppage time against the run of play.
Having won just once in 19 games, Rotherham sealed the three points as Joe Newell's excellent cross after a good run down the left was met by the head of Michael Smith.
Lukas Nmecha ensured a tense finish as he pulled one back from a tight angle a minute after Smith's goal.
The visitors had enough chances to at least come away with a point - they should have gone into the break ahead as Marek Rodak made a number of saves as Tom Barkhuizen, Paul Gallagher and Nmecha all had decent chances to score.
Ryan Williams and Vaulks both went close with long-range efforts for the Millers after the break while Nmecha had an effort cleared off the line following a great save by Marek Rodak just before Rotherham's second goal.
In the final minutes Rotherham's Semi Ajayi cleared the ball off the line again after Nmecha's pull-back was almost turned past his own goalkeeper by Michael Smith.
Bolton's 6-0 thrashing at Hull allowed the Millers to open up a three-point gap between themselves and the relegation zone, while Preston remain in 17th place.
Rotherham assistant manager Richie Barker: "It was a vital three points and after looking at other results it was even more important.
"The togetherness was excellent, the organisation was okay in a patched-up team. We had a few square pegs in round holes so we are obviously delighted to get the three points but we are well aware we need to improve things.
"The performance wasn't great but they don't know that they're beat. They dig in when things are not going so well. The character is excellent.
"Our game-management towards the end was not entertaining, but year or so ago we might have lost that game."
Preston manager Alex Neil: "I was extremely frustrated but I couldn't tell my players they hadn't played well because it wasn't true. There was real frustration and disappointment because we spurned opportunities.
"Normally Rotherham are hard to create chances against but we created six by half-time. As a coach you know when your team has played well.
"Their goalkeeper getting man of the match tells you the story of the game. The simple fact is we didn't take the opportunities that we created. They went in knowing that they had not played well. They knew they had something to hang on to."
- 26RaggettBooked at 29mins
- 11TaylorSubstituted forNewellat 45'minutes
- 4VaulksBooked at 74mins
- 8PalmerBooked at 12minsSubstituted forFordeat 45'minutes
- 25WilesBooked at 82mins
- 24SmithBooked at 83mins
- 16HughesSubstituted forWoodsat 67'minutes
- 18LedsonBooked at 31mins
- Lee Probert
- Shots on Target
Second Half ends, Rotherham United 2, Preston North End 1.
Foul by Michael Smith (Rotherham United).
Jordan Storey (Preston North End) wins a free kick in the defensive half.
Offside, Preston North End. Paul Gallagher tries a through ball, but Tom Clarke is caught offside.
Foul by Michael Smith (Rotherham United).
Paul Huntington (Preston North End) wins a free kick in the attacking half.
Ryan Williams (Rotherham United) wins a free kick on the left wing.
Foul by Ryan Ledson (Preston North End).
Joe Newell (Rotherham United) wins a free kick on the left wing.
Foul by Tom Clarke (Preston North End).
Corner, Rotherham United. Conceded by Daniel Johnson.
Semi Ajayi (Rotherham United) wins a free kick in the defensive half.
Foul by Calum Woods (Preston North End).
Attempt missed. Tom Barkhuizen (Preston North End) header from the centre of the box is close, but misses to the left. Assisted by Paul Gallagher with a cross following a corner.
Corner, Preston North End. Conceded by Joe Mattock.
Attempt missed. Lukas Nmecha (Preston North End) right footed shot from the centre of the box misses to the right. Assisted by Paul Huntington with a headed pass.
Michael Smith (Rotherham United) is shown the yellow card.
Ben Wiles (Rotherham United) is shown the yellow card for a bad foul.
Foul by Ben Wiles (Rotherham United).