Match ends, Rotherham United 1, Wigan Athletic 2.
Wigan Athletic kept their Championship survival hopes alive as they closed the gap on Rotherham United to six points.
Jermaine Pennant curled a free-kick into the top left corner to put Wigan ahead, and then found the other corner of the net from a similar set piece.
The Millers pulled one back when Matt Derbyshire headed in from close range after excellent work from Ben Pringle.
But Wigan held on to record their fourth straight away win and move six points from safety.
Paul Green had three early chances for the hosts before Pennant struck from 20 yards after James McClean was brought down.
Pennant repeated the trick less than five minutes later after Marc-Antoine Fortune had been fouled.
The hosts were handed a lifeline on the stroke of half-time when Pringle's deep cross was headed in at the back post by Derbyshire.
And Rotherham almost grabbed a late draw when substitute Jordan Bowery's close-range header was denied by Al-Habsi's fine save.
Wigan stay 22nd, a place below Rotherham who were leapfrogged by Fulham.
Rotherham United boss Steve Evans:
"If the first one is a free-kick, we should give football up. It's embarrassing for the referee.
"It's not a free-kick. We have got the benefit of having looked at it and if people want to go diving around and getting free-kicks then Wigan are welcome to them.
"I thought in the first half we were a bit average, if I can use that expression. In the second half we were fantastic."
Wigan Athletic manager Malky Mackay:
"Jermaine Pennant's delivery on both (free-kicks) was sensational.
"It's not until you look at that and look at it again that you see exactly what he did, and how he has executed those free-kicks.
"Great credit to him for the way that he's come into the football club and shown great character, personality and humility to come in."
- 5BroadfootBooked at 31mins
- 33SmallwoodSubstituted forNewtonat 87'minutes
- 23SammonSubstituted forBoweryat 74'minutes
- 11GreenSubstituted forHammillat 54'minutes
- 26Al Habsi
- 15PennantSubstituted forCowieat 76'minutes
- 11McCleanBooked at 31mins
- 18OjoSubstituted forKvistat 62'minutes
- James Linington
- Shots on Target
Second Half ends, Rotherham United 1, Wigan Athletic 2.
Daniel Lafferty (Rotherham United) wins a free kick in the defensive half.
Foul by Marc-Antoine Fortuné (Wigan Athletic).
Corner, Wigan Athletic. Conceded by Adam Hammill.
Attempt missed. Farrend Rawson (Rotherham United) header from the centre of the box is high and wide to the left. Assisted by Ben Pringle with a cross following a corner.
Corner, Rotherham United. Conceded by Don Cowie.
Foul by Matt Derbyshire (Rotherham United).
Kim Bo-Kyung (Wigan Athletic) wins a free kick on the left wing.
Attempt saved. James McClean (Wigan Athletic) header from the centre of the box is saved in the top left corner. Assisted by Marc-Antoine Fortuné with a cross.
Attempt missed. Kári Arnason (Rotherham United) right footed shot from outside the box is high and wide to the right.
Attempt saved. Jordan Bowery (Rotherham United) right footed shot from the right side of the six yard box is saved in the bottom right corner.
Attempt saved. Jordan Bowery (Rotherham United) header from the centre of the box is saved in the bottom right corner. Assisted by Daniel Lafferty.
Substitution, Rotherham United. Conor Newton replaces Richard Smallwood.
Attempt missed. James McClean (Wigan Athletic) left footed shot from the centre of the box misses to the left following a corner.
Corner, Wigan Athletic. Conceded by Adam Collin.
Attempt saved. William Kvist (Wigan Athletic) right footed shot from the left side of the box is saved in the top centre of the goal. Assisted by Kim Bo-Kyung.
Attempt missed. Jordan Bowery (Rotherham United) right footed shot from the centre of the box is too high. Assisted by Matt Derbyshire with a cross.
Farrend Rawson (Rotherham United) wins a free kick in the defensive half.
Foul by Jason Pearce (Wigan Athletic).