John Cooney's long-range penalty two minutes from time secured a 25-24 Champions Cup comeback win for Ulster over Harlequins.

Ulster trailed 24-22 in the closing stages after two second-half tries from Quins hooker Elia Elia had edged the visitors in front.

But an Adam McBurney try and Cooney's conversion left Ulster within range and Cooney's penalty made it three wins from three and left them on top of pool three.

Sean Reidy and Stuart McCloskey claimed Ulster's other tries along, both converted by Cooney, who also landed two penalties.

Quins, who earned a losing bonus point, had a try from Alex Dombrandt, in addition to Elia's double. Marcus Smith converted all three tries and added a penalty.

After a bright opening, Ulster opened the scoring with a seventh-minute Cooney penalty with Marcus Smith responding two minutes later after the home side were offside at the restart.

Louis Ludik then intercepted a long cut-out pass from James Lang with Quins on top following a dangerous run from Gabriel Ibitoye.

Cooney then held on to the ball with Ludik free outside him before Chris Robshaw's jackal on Marty Moore.

Quins crossed the line in the 24th minute after Dombrandt had initially won a Cooney kick-chase. The visitors attacked left and after Ross Chisholm made ground down the right, Kyle Sinckler's short pass put Dombrandt through two tackles to score.

Smith converted and Quins led 10-3.

Ulster hit back just after the half hour when via a penalty after Iain Henderson's rip. Billy Burns' cross-kick picked out Stuart McCloskey whose off-load released Sean Reidy to gallop over the line.

Cooney's conversion tied the scores at 10-10 which is how the half ended.

Clearly intent on making an early statement, McCloskey barrelled over in the left corner three minutes after the restart when crisp passing from Burns and Marshall gave the Ulster centre a chance to smash through Chisholm. Cooney was well wide with the extras.

Smith hit the upright with a 50th-minute penalty shot after McCloskey was pinged for a high tackle on Francis Saili.

But Quins came back three minutes before the hour. A penalty for early engagement at a maul was put into the corner and Elia surged over the line through McCloskey's tackle.

Smith converted to nudge Quins ahead and then the visiting hooker grabbed his second from a length of the field move.

It came when Ludik was pulled down short of the Quins' line and Dombrandt intercepted Cooney's pass to Coetzee and charged downfield.

He linked with Chisholm and Ibitoye before, in midfield, Elia dummied Kieran Treadwell and ran in unopposed making the extra two points a formality for Smith.

Ulster responded with a score off their own from a driving maul. A penalty was put to the corner and, after Henderson won the lineout, Ulster got early momentum and McBurney was driven over the line.

Cooney's conversion reduced the deficit to 24-22 and it then fell to the scrum-half to nail the match-winning penalty.