QPR defeated Bristol City in a seesaw Carabao Cup first-round encounter at the Kiyan Prince Community Stadium.
The deadlock was broken in the 13th minute when Antoine Semenyo played an inch-perfect through-ball to Famara Diedhiou, who rounded debutant Liam Kelly before slotting home from a tight angle.
No sooner had the visitors got the upper hand then the west Londoners were level when Nahki Wells unleashed a snapshot from 20 yards that Daniel Bentley could not get near to.
The former Huddersfield striker then turned provider, galloping down the left in the 27th minute before laying the ball off to Marc Pugh, who squared for Ilias Chair to finish from six yards.
Jack Hunt then levelled proceedings four minutes from the interval after driving inside from the right wing before powering an unstoppable drive into Kelly's top right-hand corner.
The second half did not live up to the drama of the first until 59 minutes, when Liam Walsh bent a stunning free-kick in off the bar from 30 yards to open his account for the Robins.
Ryan Manning then planted his penalty past Bentley in the 86th minute after Wells was bundled over, but with no extra time, spot-kicks were needed to separate the sides.
Bailey Wright blinked at the decisive moment, with Kelly blocking the defender's effort with his legs to send the home fans ecstatic.
No Data Analysis info