Last updated on .From the section Scottish League Cup

Midfielder Olly Lee rattled in a late winner for his second Hearts goal

Olly Lee's late strike clinched a quarter-final place for Hearts after an end-to-end Scottish League Cup battle with Dunfermline Athletic.

The midfielder rifled a 79th-minute shot through the legs of a defender and into the bottom corner.

Goalkeeper Zdenek Zlamal made two stunning saves to keep Hearts ahead.

He brilliantly tipped Andy Ryan's header on to the bar and over before blocking Aidan Connolly from point-blank range in the dying minutes.

Craig Levein's side remain unbeaten in seven competitive outings this term and will await the quarter-final draw with mounting confidence.

Inspired Zlamal keeps clean sheet

The hosts came closest to an early opener when Faissal El Bakhtaoui drilled a low shot against a post after a defence-splitting pass by James Craigen.

It was the best chance of a first half that finished with both teams contributing four shots apiece, none of which were on target.

Dunfermline played a high defensive line, giving Hearts little time on the ball and Levein made a change at the break, replacing veteran centre-back Aaron Hughes with Oliver Bozanic and dropping Peter Haring into defence.

The momentum did eventually swing in the visitors' favour, but Dunfermline were a constant threat on the break and Zlamal did well to stop a spectacular overhead kick from El Bakhtaoui.

Lee struck the crucial blow when he collected a neat Steven Maclean pass and his driven effort flew between the legs of Danny Devine en route to the home net.

Zlamal's outstanding double-salvo kept Hearts in front, although substitute Connolly will feel he should have taken the tie to extra time instead of being thwarted by the shins of the Czech.

Lafferty bidding farewell?

After scoring the winner against Celtic last week, Kyle Lafferty said he hoped he had repaid the "superb" Hearts contribution to his career with goals.

That thunderous volley was the Northern Irishman's 20th since joining the club last summer, including efforts in two wins over the Scottish champions and an Edinburgh derby goal.

Talks are ongoing between Hearts and Rangers and Lafferty could still return to Ibrox for a second spell before the transfer window shuts.

A substitute in Fife, he took the acclaim of the travelling fans at full-time, handing his shirt to a young supporter behind the goal. Was there an air of finality to his encore? Time will tell.

'Laboured Hearts & impressive Dunfermline' - analysis

At times, Hearts looked laboured and heavy legged against a Dunfermline team who rarely gave them a minute to settle. But you also have to praise the Premiership leaders for sticking by their plan.

On this performance, Dunfermline will surely be up towards the top end of the Championship. And, if they can find the killer instinct in front of goal, they could prove to be title contenders.

'Defeat is hard to take'- reaction

Dunfermline Athletic manager Allan Johnston: "I'm proud of the players. It was an excellent performance, they gave everything they've got and we're so unlucky to get beaten.

"I can't really remember Hearts having any opportunities. We defended really well, looked a threat going forward and it's hard to take getting beaten like that."

Hearts attacker Steven Naismith: "It's good to win this way every now and then to know that we have progressed, when the going is tough and they are making it difficult for us.

"They dug in. We could have been much better with our decision-making against a team that are trying to trap us with silly balls in the middle of the park."