A fortunate second-half winner from QPR’s Morgan Fox condemned the Town to their 10th successive away defeat on the road.
The Rangers defender inadvertently diverted Ilias Chair’s strike beyond the reach of Thomas Kaminski to break Hatters hearts away from Kenilworth Road once more.
After trailing to Michael Frey’s 24th-minute opener the Hatters went in level at the break thanks to a bullet header from Mark McGuinness.
The Hatters started the second half in the ascendancy only to then fall behind to Fox’s goal.
Rangers spurned a number of chances to add to their advantage, but the Town came close to snatching a late leveller when McGuinness came close with another towering header but time ran out and the Hoops held out.
Lamine Fanne was given his debut in one of three changes to the side that lost at home to Norwich on New Year’s Day.
But it was the home side that forced the first chance in the seventh minute when free Frey’s header from close range was clawed away by Thomas Kaminski.
And the Hatters had their goalkeeper to thank for a fantastic save on 19 minutes when he threw up a hand to somehow keep out Jimmy Dunne’s header. Dunne then fired the loose ball over the crossbar when it seemed harder to miss.
Five minutes later, however, Rangers were not to be denied when Frey outmuscled Reuell Walters at the back-post and guided a finish past Kaminski from an acute angle.
Behind, back came the Hatters. And on 29 minutes Tahith Chong teed up Amari’i Bell to fire a shot that was blocked. Chong and Zack Nelson could not find the finishing touch as the ball broke free before Rangers then charged down efforts from Carlton Morris and Liam Walsh.
Marvelous Nakamba swept a shot over the bar two minutes before the break but, on the stroke of half-time, the Town were level. Chong won a corner from the right that was swung in by Nelson and McGuinness rose the highest in the whole of West London to nod home his second goal of the season the day after his 24th birthday.
The Hatters came out where they left off at the start of the second period with Walsh and Lamine Famine going close inside a two-minute spell.
And as the Town began to get on top, Lamine Fanne slipped at the crucial moment when firing a shot at goal on 55 minutes.
However, a stoppage in play while Rangers’ Paul Smyth received treatment quelled the Hatters’ momentum and from a short free-kick, Fox – appearing to jump out of the way of Chair’s shot – cannoned off the left-back’s trailing foot, flat-footing Kaminski with the ball rolling agonisingly over the line.
The Hatters came close to level almost immediately when Morris’ back-post header was kept out well by Rangers keeper Paul Nardi.
But Rangers should have the three points wrapped up when spurning three chances in the space of four minutes with Alfie Lloyd guilty of missing two of those, including one which pinged off the foot of the post.
Rob Edwards rolled the dice late on, using five substitutes, and the Town almost earned a point in the third minute of seven added on when McGuinness met Walsh’s corner – only for the defender’s header to whiz inches over the bar and that was that.
Town: Kaminski, Walters (sub Clark 85), Bell, McGuinness, Holmes (sub Hashioka 85), Chong, Nakamba (sub Adebayo 74), Lamine Fanne (sub Woodrow 85), Walsh, Nelson (sub Brown 77), Morris.
Subs not used: Krul, Andersen, Krauß, Mpanzu.
Attendance: 14,025, including 1,010 shouting for the Town.