Cauley Woodrow rescued Barnsley a point at Oakwell with a penalty in the 12th minute of injury time as a 2-2 draw ended Bristol City's perfect start to the season.
Goals from Jack Hunt and Tyreeq Bakinson in the first six minutes of the second half turned the game around for City after Barnsley took the lead in the second minute of the game through Michal Helik.
But in the fifth minute of added time, Michael Sollbauer was fouled and had to receive lengthy treatment before Woodrow was able to take the spot-kick.
The match started at a frantic pace, and within two minutes Barnsley took the lead.
Romal Palmer lofted a corner in towards the back post, and defender Helik was on hand to power home the header from close range to give Barnsley a flying start.
The Robins almost replied a minute later, as a Tommy Rowe corner was headed just wide by Andreas Weimann.
City came close to grabbing an equaliser yet again in the 17th minute when Hunt ventured forward and, with the ball at his feet on the edge of the area, had a strike at goal. The shot deflected upwards and hung in the air for a long time, before Chris Martin met the ball inside the six-yard area, but his header went wide.
City's best chance of the half came five minutes before the break, when a long ball pumped forward by Hunt was headed down by Martin and fell to the feet of Nakhi Wells.
He tried to prod the ball home past an onrushing Jack Walton in the Tykes goal, but defender Jordan Williams was in the right place for his side and was able to clear off the line.
Two minutes after the restart and City were level. A counterattack led by Wells resulted in the striker having two efforts on goal saved by Walton. After a Jamie Paterson shot was then well blocked, Martin laid the ball to Hunt, who had just arrived in the area to rifle an effort past the unfortunate Walton.
A Paterson cross from out wide was palmed away by Walton four minutes later, but his parry fell straight to the feet of Bakinson on the edge of the area, who tried to place his effort and with the aid of a deflection found the back of the net.
After the second City goal, there was very little action for the rest of the half until the 95th minute.
Sollbauer was fouled inside the area by Callum O'Dowda, taking a nasty blow to the head in the process.
After several minutes of treatment and the defender being taken off on a stretcher, Woodrow kept his nerve to convert the penalty.
What the managers said...
Barnsley caretaker boss Adam Murray: "It's horrible, I think it's one of those challenges that we don't really see in the game anymore. I've got to give credit to Solly (Michael Sollbauer) for putting his head in a place where he knew he was going to get hurt, but obviously it was a benefit for the team and I think that sums him up as a player.
"The last few moments were strange to be honest, because the moment went on for so long. You had their players messing with the penalty spot and trying to get into Cauley's head. The penalty going in under that pressure is fantastic for Cauley and I felt we deserved that. We deserved to get something from the game."
Bristol City's Dean Holden: "It was a cruel ending in many ways. First and foremost our thoughts go out to the Barnsley centre-back, he didn't look in a good way, so fingers crossed he's OK. It doesn't look clear enough for me to give a penalty, though, I've got to be honest, but we have to get on with it.
"We had opportunities to take the game away from them, but if you don't do that then you're always at the mercy of a referee's decision or an equaliser."