Glentoran suffered their first defeat of the season as Peter Thompson grabbed Linfield's winner in the County Antrim Shield quarter-final at the Oval.
Brian McCaul had shot Linfield into a 24th-minute lead but Jim O'Hanlon got Glentoran level 10 minutes later.
Former Glens star Daryl Fordyce fired the Blues into a 2-1 lead only for Jimmy Callacher to head the home side's second equaliser in the 88th minute.
Just 45 seconds later Thompson's near post header gave Linfield the victory.
It was Linfield's first win over the Glens in six meetings, having lost the four Premiership matches last season and this term's 1-1 draw in the league.
For Glentoran, it was a first defeat of the season in all competitions.
The Glens had made the brighter start and McCaul's opener was a bit against the run of the play.
Jamie Mulgrew supplied the cross and McCaul got in front of a defender to scoop the ball in.
Sean Ward did the spadework for Glentoran's equaliser, beating a couple of defenders and then delivering into the area where O'Hanlon got in ahead of Albert Watson to shoot in.
The match went through a quiet spell in the second half but burst into life with a dramatic finale.
Fordyce, back on his old stomping ground, made it 2-1 on 84 minutes, firing in after the ball had spun into his path as home keeper Elliott Morris came out to deny Thompson.
Callacher headed in from David Howland's free-kick for 2-2 and it looked like going to extra-time until Thompson beat Morris to head in from Jim Ervin's ball into the danger area.