Dundalk 2 Coleraine 3: Coleraine are in pole position to be the Danske Bank Premiership's sole representatives in the semi-finals of the Setanta Sports Cup.
Oran Kearney's men fought back after going 1-0 down in the early stages to seal a thrilling 3-2 win over Dundalk in the quarter-final first-leg.
David McDaid's double, along with a Ruairi Harkins strike mean that the Bannsiders will hold the upper hand going into the second leg at The Showgrounds in a fortnight.
Dundalk took the lead in the 18th minute when Stephen O'Donnell's beautiful back heel opened up the Coleraine back four and his fellow Galwegian, Daryl Horgan, was on hand to curl the ball past Ferry.
The Lilywhites were stunned in the 34th minute when the Coleraine nabbed a crucial away goal thanks to a stunning effort from David McDaid, his 25-yard drive going in off the underside of the crossbar.
They then took control of the tie with two goals in the space of nine minutes early in the second-half.
McDaid made it 2-1 after 49 minutes when he prodded home at the back post from Ruari Harkin's delicious cross. And Harkin sent the travelling fans into raptures when he took advantage of some shambolic Dundalk defending to squeeze a drive past Peter Cherrie nine minutes later.
Dundalk were given hope when David McMillan rose to power home a Dane Massey corner four minutes later.
The home side squandered late opportunities through Kurtis Byrne and Hoban as Coleraine held on to set up a tasty looking return tie.
Dundalk: Cherrie; Rossiter, Kelly (Mountney 86 mins), Boyle, Massey; O'Donnell, Towell, Higgins (Meenan 78 mins); Horgan (Byrne 67 mins), Hoban, McMillan.
Coleraine: Ferry; Watt, Douglas, Canning, McNeil; Harkin, Lowry, Hegarty, Owens (Bradley 88 mins); McDaid, Browne (Tommons 52 mins).
Referee: Paul McLaughlin (Donegal).