Dungannon edged out the Bannsiders in an entertaining Irish Cup sixth round encounter at the Showgrounds.
Grant Hutchinson curled into the top corner to put the Swifts ahead but Joe McNeill diverted a mishit shot into the net to level before the break.
The visitors regained the lead when Ryan Harpur stroked home and Johnny Topley made it 3-1 with a wind-assisted cross which beat keeper Eugene Ferry.
Eoin Bradley's free-kick set up a tense finish but Dungannon held on to win.
Coleraine bossed possession early in the game and Bradley rounded keeper Gareth Buchanan but hit the side-netting.
The Swifts always posed a threat and Hutchinson made the breakthrough on 39 minutes with a stylish finish.
McNeill equalised just three minutes later, turning a tame shot into the net from six yards.
Harpur's half-volley arrowed into the bottom corner as the Swifts moved 2-1 in front after 52 minutes.
Dungannon's third owed much to luck, as Topley's cross was hit by the wind and the ball flew into the top corner.
Bradley gave Coleraine hope when he clipped a 20-yard free-kick home with two minutes remaining.
The Bannsiders wasted two good chances to level in injury-time, first when Howard Beverland headed over from four yards before Gary Browne volleyed over at the backpost.
Darren Murphy's team will take on Ballymena United at the Showgrounds in the quarter-finals.