Ryan Wintle came off the bench to fire home a 97th-minute winner from the penalty spot as Cardiff earned their first win of the season with a 2-1 victory over Sheffield Wednesday.
The game seemed to be drifting towards a draw until former Cardiff player Will Vaulks was adjudged to have handled the ball as he dived to head clear a cross from the left.
Referee Darren Bond had no doubt it was a handball and Wintle calmly stepped up to slot the ball inside the left post to give new manager Erol Bulut his first taste of victory in the Championship.
It was cruel luck indeed for battling Wednesday, who thought a goal from their inspirational skipper Barry Bannan was going to be enough to earn them their first point of the season after gaining promotion from League 1.
Bannan completed a final quarter revival for Wednesday with a superb left-footed shot from the edge of the 'D' that flew past Jack Alnwick and hit the top left corner.
It was nothing less than the visitors deserved for the concerted period of pressure they applied after going down 1-0 two minutes into the second half. Ike Ugbo's third goal in four games had given the Bluebirds the lead after a below-par first half from both teams as they sought their first win of the Championship campaign.
Bulut had demanded more goals from his side and he would have been bitterly disappointed that Yakou Meite sent a point-blank header wide on the half-hour mark.
But there was no hiding his joy when one of his other new signings Ugbo, who joined from French Ligue 1 side Troyes in the summer, smashed home from close range.
The irrepressible Aaron Ramsey had a hand in the build-up down the right and his measured pass to Perry Ng allowed the full back to cross to the far post. Callum O'Dowda headed back across goal and Ugo chested the ball down before volleying into the roof of the net.
O'Dowda should have made it 2-0 five minutes later when Joe Ralls sent him racing clear into the box. He was through one-on-one with Wednesday keeper Devis Vasquez, but the Colombian on loan from AC Milan came out on top as he cleared the shot with his legs.
After that it was all Wednesday moving forward and threatening to add to Cardiff's miserable run of home form.
Alnwick was forced to making a flying save to keep out a Josh Windass header in the 68th minute and then Windass headed agonisingly across goal from a Bannan cross.
Bannan's strike got Wednesday on level terms on 76 minutes before the added-time penalty drama secured a precious win for the Bluebirds.
Cardiff City: Alnwick, Ng, McGuinness, Goutas, Collins (Grant 80’), Siopis, Ralls © (Wintle 80’), Ramsey (R. Colwill 80’), O’Dowda, Méïté (Etete 88’), Ugbo (Tanner 72’). Subs not used: Rúnarsson, Sawyers, Adams, Rinomhota.
Sheffield Wednesday: Vásquez, Palmer, Diaby, Byers (Vaulks 62’), Gregory (Bakinson 92'), Bannan ©, Windass, Paterson, Delgardo (James 86’), Bernard, Smith (Fletcher 62’). Subs not used: Dawson, Iorfa, Valentin, Ihiekwe, Musaba.