Rodney Brown fired home a late winner to help fire Coleraine up to second in the Danske Bank Irish Premiership table.
With the game at Ballinamallard tightly poised at 1-1 with six minutes to go on Friday night, Brown kept his nerve to fire in from just outside the box.
It was a fantastic three points for the Bannsiders, who lost James McLaughlin to injury in the warm up and skipper Howard Beverland just befor half time with a head wound.
Ian Parkhill had put them in front in the first half before Adam Lecky levelled things up just before the hour mark.
Brown’s late strike sent the Bannsiders on the long journey home absolutely delighted.
“It was a tough game, but it is nice to see us coming away with a win and the three points,” said boss Oran Kearney afterwards.
“Although we like coming here, and it’s a great surface which suits us, in the same stretch Ballinamallard always give us a tough game.
“Their record against us over the last few years speaks for itself.
“It’s nice to be coming away from here for the first time with three points this season.
“It’s the fine margins which are the difference between three points and not.
“I’ve seen us come here in the past and maybe play better, but we’ve come away with nothing to show for it.
“I’ve been in football long enough to know how it works, the peaks and the troughs of it all.”
The first half was slow to get going with neither goalkeeper called into action during the opening quarter, but it was Ballinamallard who were enjoying the better of the exchanges as the half progressed.
However, an error by home goalkeeper Stefan McCusker, who was standing in for the suspended Alvin Rouse, gifted the visitors the lead on the half hour mark.
There was some tidy play in the build up to the goal from the lively Jamie McGonigle as he lifted the ball over a defender, but his shot did not look as if it would cause any bother to the Mallards custodian.
McCusker though spilled the ball and Parkhill, who only came into the side at the last minute after McLaughlin picked up a knock prior to kick off, was on handto force the ball over the line.
The home side were again on the front foot at the start of the second half and McCartney slid in Martin who was denied by a good save from Doherty.
An equaliser did arrive though in the 57th minute when the influential Lecky headed home a McCartney corner from the left.
However, Coleraine had their best spell of the game as the contest entered the final 15 minutes.
McCusker atoned for his earlier mistake as he denied McGonigle while Colm McLaughlin then made a last ditch block to turn behind a Parkhill shot.
The Bannsiders continued to press though and winner was to arrive in the 84th minute and it was a terrific effort from substitute Brown that sealed all three points as he cut in from the left and unleashed a fierce drive that flew into the corner to send Coleraine second.
“We went in at half-time 1-0 up but I was disappointed that we conceded from a corner, but Ballinamallard really had a purple patch during that spell,” continued Kearney.
“When the corner went in I nearly feared for the worst. I wasn’t sure if we had much left in the tank.
“But credit to the lads, we found the strength of character, will and courage and I felt the last 15 minutes we kicked on again and went up another gear.
“We had two or three good chances before Rodney scored, but his strike was a great one with the outside of his foot.