Match ends, Swansea City 4, Rotherham United 3.
Rotherham's survival hopes were dented in controversial fashion as Swansea City edged a thrilling contest 4-3.
Rotherham led 2-1 thanks to goals from Michael Ihiekwe and Matt Crooks, with Oli McBurnie replying for the hosts.
Swansea improved considerably after the break, levelling through Barrie McKay before their questionable third goal.
Rotherham felt Kyle Naughton handled George Byers' shot to make it 3-2, before McBurnie scored again, only for Will Vaulks' strike to make it 4-3.
Swansea's win was their sixth in succession at the Liberty Stadium, their best home run in 11 years.
But a dreadful sequence of results on the road looks to have ended any hope of a late-season play-off push.
Away form has also been the problem for Rotherham, who have managed just one win on their travels all season.
They looked intent on making it two from the outset in south Wales, with Paul Warne's physically imposing side proving too strong for Swansea in the first half.
Graham Potter's team have had trouble defending set-pieces in recent months and their problems continued here, as Rotherham's first-half goals came from Vaulks' long throws.
The first was initially cleared by Swansea, but Wales international Vaulks sent the ball back into the box and centre-back Ihiekwe got a touch to beat Kristoffer Nordfeldt.
The second was more straightforward, with Crooks hooking home on the half-volley after Swansea failed to deal with Vaulks' delivery once more.
The home side had briefly levelled through McBurnie, who headed in from a Matt Grimes corner, but Rotherham were worth their half-time lead.
The Millers' greater need for points had been apparent up until that point, but Swansea emerged with more purpose after the break.
Daniel James, hailed by Warne before the game as one of the Championship's standout players along with Aston Villa's Jack Grealish, was well dealt with by Rotherham in the first period.
But when he finally found some space on 50 minutes, James waltzed past his marker and delivered the perfect cross for McKay to head home.
Swansea took control, with James going close himself before George Byers' shot went in, possibly thanks to a touch from Naughton.
Rotherham were furious, and the contest looked over when McBurnie curled home his second goal.
But the Millers were not finished, with Vaulks volleying in via the underside of the bar seven minutes from the end.
Nordfeldt made a sharp save to deny Michael Smith as Swansea held on to condemn Rotherham to what may prove a key defeat.
Swansea manager Graham Potter told BBC Sport Wales: "It's not easy to play against Rotherham. They make it really difficult with their style but credit to the boys, they've scored four goals and come through.
"I am really proud of the players. You can see it mattered to us against a team who are fighting to stay up.
"We are feeling good at home. I always thought this would be a tricky game but the fans helped us and we showed character to come back.
"I couldn't see (whether Kyle Naughton handled) from where I was. I remember the first goal they scored up there earlier in the season was an offside goal and the second was a dubious handball. I've not seen it back so I don't know, but that's life sometimes."
Rotherham manager Paul Warne: "You'll be surprised to know I think it was a handball. I haven't seen it back, but I've never seen my players react like they did.
"I think it hit his arm and was deflected away from the keeper. If I'm wrong I apologise in advance, but I don't usually see our players react like that.
"I am not disappointed with the result. We have had better days at the office obviously, but we are a positive group.
"We will lick our wounds and try to win the three games we have left. There's no reason why we can't do that."
- 5van der Hoorn
- 27FultonSubstituted forByersat 45'minutes
- 19McKaySubstituted forRodonat 75'minutes
- 15RoutledgeSubstituted forBaker-Richardsonat 89'minutes
- 5AjayiBooked at 13minsSubstituted forTowellat 57'minutes
- 17CrooksSubstituted forWilesat 82'minutes
- 11TaylorSubstituted forWilliamsat 79'minutes
- Keith Stroud
- Shots on Target
Second Half ends, Swansea City 4, Rotherham United 3.
Attempt missed. Daniel James (Swansea City) right footed shot from the left side of the box is close, but misses to the left. Assisted by George Byers.
Foul by Matt Grimes (Swansea City).
Clark Robertson (Rotherham United) wins a free kick in the attacking half.
Attempt blocked. Ryan Williams (Rotherham United) left footed shot from outside the box is blocked. Assisted by Ben Wiles.
Corner, Rotherham United. Conceded by Mike van der Hoorn.
Corner, Rotherham United. Conceded by Kristoffer Nordfeldt.
Attempt blocked. Will Vaulks (Rotherham United) right footed shot from outside the box is blocked. Assisted by Richard Towell.
Foul by Courtney Baker-Richardson (Swansea City).
Clark Robertson (Rotherham United) wins a free kick in the defensive half.
Attempt missed. Anthony Forde (Rotherham United) right footed shot from outside the box is just a bit too high. Assisted by Richard Towell.
Attempt saved. Michael Smith (Rotherham United) right footed shot from the centre of the box is saved in the centre of the goal. Assisted by Will Vaulks with a cross.
Corner, Rotherham United. Conceded by Oliver McBurnie.
Substitution, Swansea City. Courtney Baker-Richardson replaces Wayne Routledge.
Corner, Rotherham United. Conceded by Joe Rodon.
Foul by Connor Roberts (Swansea City).
Will Vaulks (Rotherham United) wins a free kick on the left wing.
Offside, Swansea City. Joe Rodon tries a through ball, but Wayne Routledge is caught offside.
Matt Grimes (Swansea City) wins a free kick in the defensive half.