Rotherham United hung on to record their second victory under caretaker manager Paul Warne as they beat Championship visitors Wigan Athletic 3-2.
Warne's men bossed the first half and led 3-0 at the break, but the second period belonged to Wigan who had a goal disallowed in the dying seconds.
Rotherham's early dominance was rewarded in the eighth minute with a goal from an unlikely source.
Skipper Lee Frecklington mishit his shot and the ball was then rifled into the net by centre-half Aimen Belaid.
It was the Tunisia international's first ever goal for the club, although his volley was so assured and emphatic it looked like it was something he does every week.
It set the tone for more to come as the Millers bossed the first half and finished it 3-0 ahead.
10 minutes after the opener, Anthony Forde was just wide at the back post after a Danny Ward cross, Richard Wood's header was cleared off the line moments later and then Tom Adeyemi curled a 20-yarder just wide.
Warne's men were full of threat and endeavour, with Izzy Brown and Adeyemi really standing out, and they were 2-0 ahead just after the half-hour mark when Ward shot from outside the penalty area and the ball deflected in off Wood.
The visitors were being hassled out of possession by relentless Millers pressing.
Adeyemi smashed a stunning 20-yarder on to the bar after a driving run and as the half edged into time added on Ward shot again and it hit the net, with Adeyemi lurking, with the help of Latics defender Dan Burn.
Wigan reduced the deficit six minutes into the second half when Yanick Wildschut steered a low shot beyond Lewis Price's left hand as the game changed completely and the visitors took control.
Rotherham looked to have ridden a long spell of pressure but Jordi Gomez swept in a 79th-minute goal to set up a nail-biting finale.
The bottom-placed Millers managed to see out the game to give Warne a second win in his five matches in charge and reduce the gap between them and safety from 12 points to nine.
Rotherham United (4-4-1-1): Price; Fisher, Wood, Belaid, Mattock; Forde, Adeyemi, Frecklington, Newell (Vaulks 84); Brown (Odemwingie 67); Ward. Subs not used: Bilboe, Kelly, Broadfoot, Taylor, Blackstock.
Wigan Athletic (4-4-2): Jaaskelainen, Kellett (Byrne 80), Buxton, Burn, Warnock; Jacobs, Gomez, Power, Wildschut; Grigg, Davies (Le Fondre 56). Subs not used: Lavercombe, Flores, Woolery, Burke, Stubbs.
Goals: Belaid 8, Wood 32, Burn og 45+1 (Rotherham); Wildschut 51, Gomez 79 (Wigan).
Referee: David Coote (Nottingham).
Attendance: 10,158 (1,241).