Ulster survived the sending-off of Stuart McCloskey and the sin-binning of Franco van der Merwe to eke out a deserved victory at Murrayfield that lifts them up to second in the Pro12 table.

Before centre McCloskey was shown the red card for dangerous play - albeit not high up the scale of such offences - Ulster had underlined their superiority by retaining possession much better than Edinburgh and by exerting huge pressure on the hosts in the third quarter.

Ruan Pienaar, who switched to out-half late in the contest, had an outstanding game, not least with his place kicking, the Springbok kicking four from four in a perfect display.

The other player who caused damage was the burly Nick Williams, who played a big part in both the Ulster tries.

Despite dominating possession early on, Ulster fell behind to an eighth-minute try from Edinburgh centre Phil Burleigh, following a break by hooker Neil Cochrane and good passing from Mike Coman and Roddy Grant.

Ulster quickly responded with power play from their forwards, short drives to the line and then a deadly finish from two metres out by Pienaar, who added the simple conversion.

A penalty from out-half Tom Heathcote regained the lead for the home side but he missed his next shot off the tee before succeeding with two kicks on either side of a penalty by Pienaar to give Edinburgh a 14-10 half-time advantage.

Ulster looked much more purposeful in the second half and gained an early reward with a second penalty by Pienaar.

The visitors then took the lead with a fine try by Ireland centre Darren Cave after the barnstorming Williams had broken through two tackles, Pienaar's conversion opening up a six-point lead.

Dominant

But just when Ulster seemed to be establishing a dominant position indiscipline reduced the visitors to 14 men with the dismissal of McCloskey, shown the red card by referee Leighton Hodges for lifting flanker Hamish Watson on to his head at a ruck.

Edinburgh mad their numbers count with a penalty by Heathcote to bring the scoreline to 20-17 but their incompetence in the final ten minutes when Ulster were reduced to 13 men after lock Van der Merwe was yellow-carded allowed the visitors to hold out.