Teenage substitute Ray Jones scored his first career goal as QPR edged past Northampton in the Carling Cup.
Rangers took control early on when Lee Cook's low drive and Kevin Gallen's deflected free-kick put them 2-0 up.
Andy Kirk had already hit the post for the Cobblers when Jerome Watt pulled one back with a 25-yard strike.
Kirk levelled things up on 78 minutes with a superb curling shot but with extra-time looming, Jones met Marcus Bignot's cross to nod home the winner.
QPR: Cole, Bignot, Rehman, Stewart (Kanyuka 90), Howell,
Baidoo, Bailey, Bircham (Ray Jones 84), Cook,
Gallen (Oliseh 77), Blackstock.
Subs Not Used: Paul Jones, Donnelly.
Booked: Ray Jones.
Goals: Cook 18, Gallen 50, Ray Jones 87.
Northampton: Bunn, Crowe, Chambers, Dyche,
Brett Johnson (Bojic 69), Bradley Johnson (Watt 45), Jess,
Burnell, Aiston, Kirk, Quinn (Gilligan 85).
Subs Not Used: Harper, Cross.
Goals: Watt 55, Kirk 78.
Ref: P Miller (Bedfordshire).