Glasgow Warriors battled their way to a United Rugby Championship win over Ulster in tricky conditions at Scotstoun.
The visitors edged the first half, and led at the break through Harry Sheridan's try and Nathan Doak's penalty after Sione Vailanu crossed for Glasgow.
Second half tries from Jack Dempsey and Fraser Brown swung the game Glasgow's way though, before John Cooney's late penalty secured Ulster a losing bonus point.
Glasgow climb up to fourth in the URC table, while Ulster stay third.
The weather gods were not kind to Glasgow. A game that promised much was hit with incessant rain and a battle ensued as a result. Glasgow eventually got there and they deserved their win, their ninth in a run of 10 undefeated games. They took their chances where Ulster did not. That was the story of the night.
The galling thing for Ulster was that they only had a three-point cushion at the end of a first half that they largely dominated. They had a tough enough beginning - soaking up some early pressure and conceding a try to Vailanu after Glasgow made the most of a spillage from Ethan McIlroy - but, overall, they controlled things.
Their wastefulness must have driven them scatty. They had an attacking lineout inside Glasgow's 22 and lost it. They had another attacking lineout in similar territory and had it stolen. They went again a third time and once more they coughed it up out of touch.
That was only for starters. They had more terrific field position soon after - and we were only midway through the half at this point - but when they crashed over the Glasgow line they were done for a double movement.
They went back for a penalty advantage, tapped and bullocked from close range but got held up. The upside was that they were miles on top. The downside was that looking a gift horse in the mouth at Scotstoun, where Glasgow's record is so strong, isn't the greatest approach. They'll know more about that now.
At last, though, their pressure told when yet another lineout spitting distance from the Glasgow line was executed properly, Sheridan driven over to level it.
In the incessant rain, this was never going to be pretty, never going to be the kind of night where Glasgow could give full expression to their attacking game. It became a forward grind and Ulster looked far more comfortable until it turned later on. Glasgow's penalty count went to nine before the end of the half.
Ulster went at Glasgow again shortly before the break, piled on the heat and the phases around the five-metre line, but stout defence kept them out. Doak eventually gave them that half-time lead when booming over a penalty from a mile out. A three-point gap told us nothing about the balance of play.
Dan McFarland, back on familiar terrain, continued to watch with a furrowed brow as Ulster's profligacy carried on and on. More Glasgow indiscipline brought Ulster back into the home 22. They had a penalty and a fairly easy three points that would have stretched their lead to six. In such a tight game it wouldn't have been such a crazy call.
Instead, they went for touch, rumbled awhile and then got turned over. Straight after, they misfired on back-to-back lineouts. To add salt to the wound, Glasgow had the same dilemma soon after. Like Ulster, they went for touch rather than posts. Unlike Ulster, they scored, Dempsey coming round the front of the lineout to blast over.
The conversion was missed, so it was a two-point game in Glasgow's favour. Little about Glasgow was fluid, but they played smart rugby from there. They pinned Ulster back, kept them in their own half, took control of a tough situation and kicked on to win.
Their ability to take the chances that came their way was the difference and the match-winner was more proof of that. Where Ulster failed with so many lineout opportunities, Glasgow put another one away. A big maul and Brown broke free to score. Weir banged over the conversion and it was 17-8.
Cooney gave Ulster the crumb of a losing bonus point with the last kick. Sloppy from Glasgow. In the big picture of the league table they could have done without Ulster getting that small comfort. The win, though, was pleasing enough on an imperfect night.
Glasgow: Ollie Smith; Sebastian Cancelliere, Stafford McDowall, Sam Johnson, Cole Forbes; Tom Jordan, Jamie Dobie; Nathan McBeth, Johnny Matthews, Lucio Sordoni; Lewis Bean, Scott Cummings; Thomas Gordon, Sione Vailanu, Jack Dempsey.
Replacements: Fraser Brown, Jamie Bhatti, Simon Berghan, JP du Preez, Alex Samuel, Euan Ferrie, Ali Price, Duncan Weir.
Ulster: Ethan McIlroy; Ben Moxham, James Hume, Stewart Moore, Jacob Stockdale; Billy Burns, Nathan Doak; Eric O'Sullivan, Tom Stewart, Jeff Toomaga-Allen; Alan O'Connor (capt), Kieran Treadwell; Harry Sheridan, Jordi Murphy, Nick Timoney.
Replacements: John Andrew, Rory Sutherland, Andy Warwick, Cormac Izuchukwu, Greg Jones, John Cooney, Luke Marshall, Craig Gilroy.