West Bromwich Albion moved to within a point of the Championship promotion places as Jake Livermore's 94th-minute winner gave them victory at Queens Park Rangers.
The Baggies took the lead when Jefferson Montero fired in from six yards on his first start since joining on loan from Swansea last month.
Luke Freeman then levelled with a near-post strike, before Jacob Murphy's breakaway goal restored the visitors' advantage.
Tomer Hemed equalised from penalty spot to make it 2-2 but, after the hosts were reduced to 10 men following an injury to Freeman with all three substitutions already made, Livermore struck.
The Baggies stay fourth, but are just three points behind leaders Norwich City and one point behind Sheffield United and Leeds United - although Marcelo Bielsa's side have played a game fewer.
Darren Moore's Baggies won August's reverse fixture 7-1 at The Hawthorns, but this was a vastly improved showing from Steve McClaren's side, who enjoyed long spells of dominance.
After Hemed had levelled for a second time, it was the home team who looked the more likely to go on and win the match, before Freeman's injury appeared to alter the course of the game.
Rangers, who were beaten by Premier League Watford in the fifth round of the FA Cup on Friday, have now lost their last six games in all competitions and are winless in the league since 26 December.
It is a run of form that has seen the west London club slump from eighth in the table, two points off the play-offs, to 18th - 14 points away from the top six.