Rhyno Smith's late penalty snatched a 31-29 home win for Benetton over Ulster in the United Rugby Championship.
Eric O'Sullivan's early try put Ulster ahead but the Italians hit back through scores from Tomas Albornoz and Onisi Ratave to lead 17-10 at the break.
Rob Herring's try cut Benetton's lead to five but Juan Ignacio Brex's score helped move the home side 28-15 up.
Ulster seemed to have snatched victory after a Michael Lowry score and penalty try before Smyth's last-gasp penalty.
The defeat is Ulster's fifth loss in six games and the first time the Italian side have beaten an Irish province since 2017.
Ulster side started the game with the majority of territory and possession but struggled to convert early dominance into points due to a malfunctioning line-out.
Their persistence was eventually rewarded with a well-taken try from prop O'Sullivan who chose a good line to crash over from close range.
The hosts quickly responded with Argentina international Albornoz levelling the scores with an incisive break through Ulster's defence to cross the line and set himself up for a straightforward conversion.
Benetton stepped up in the second quarter and continued to probe and stretch the Ulster defence.
A frantic passage of play resulted in Ulster being caught short in numbers out wide and a clever kick from Brex was collected by winger Ratave who dotted down in the corner.
A penalty each kept Ulster in touch at the break before the Italian side started second half with an early Albornoz drop-goal nudging his side further ahead.
Ulster secured possession from a line-out and advanced to their opponents' line courtesy of a rolling maul, with Ulster hooker Herring steering his side over and dotting down to bring Ulster within touching distance. Cooney missed a tricky conversion leaving the deficit at five points.
An impressive long-range penalty from full-back Smyth followed shortly after by a fantastic sweeping backs move finished by Brex in the corner seemed to have Benetton in control but there was still time for more drama to unfold.
Several strong Ulster carries saw them camped on the Benetton line and it was full-back Lowry who used his footwork to burrow over with Cooney adding the vital extras as they sensed a comeback win.
And when further Ulster pressure yielded a penalty try in the 74th minute, the visitors suddenly held a one-point lead.
But in the dying moments of the game, Benetton were awarded a penalty after Cooney was caught offside and Smyth was accurate with the boot to clinch a dramatic win in a very tight contest.
Dan McFarland's now face a tough couple of weeks with back-to-back Champions Cup games against La Rochelle and Sale.
Benetton: Smith, Padovani, Brex, Menoncello, Ratave, Albornoz, Garbisi; Zani, Nicotera, Ferrari, Cannone, Ruzza, Negri, Lamaro, Cannone.
Replacements: Maile, Traore, Pasquali, Favretto, Pettinelli, Hidalgo-Clyne, Umaga, Zanon.
Ulster: Lowry, Baloucoune, Hume, McCloskey, Stockdale, Burns, Cooney; O'Sullivan, Herring, Toomaga-Allen, Treadwell, Henderson (c), Jones, Reffell, Timoney.
Replacements: T Stewart, Sutherland, Warwick, O'Connor, Vermeulen, Doak, S Moore, McIlroy.