Marius Zaliukas' name has already been etched into the venerable history of Heart of Midlothian Football Club.

However there is little doubt that, for all he is a competent – sometimes excellent – defender, Zaliukas has never quite lost that penchant for a glaring error or a comical lapse. Last night's Scottish Communities League Cup tie against Livingston was a tour de force of Marius.

Hearts' captain was directly responsible for the strike which restored parity in the second half but, showing admirable character and willingness to make amends, drove his side into the quarter-final with a double riposte.

Livingston, dominating the opening stages, delightfully crafted the first chance and almost produced the opening goal within 10 minutes. Stefan Scougall surged forward and produced a sumptuous ball to send Marc McNulty scampering in on goal. His low drive, however, zipped past the post.

An acrid haze drifted across the field as the rowdy band of Livingston supporters in the Roseburn Stand released smoke bombs. As the mist cleared from the pitch, Hearts appeared to snap from the foggy malaise which typified their performance.

Andy McNeil, the Livingston goalkeeper who won this competition with Hibernian in 2007, was forced to make two fine saves from Scott Robinson. He pushed a header from the 20-year-old over the bar, then blocked a low shot from the same man following some fine build-up from Callum Paterson.

On the stroke of half-time, the visitors' resistance was broken. Grainger attempted a shot from 35 yards and the ball deflected against Craig Barr, sending it spinning past the forlorn McNeil.

The weather in the capital had been dreich in the first half; after the interval you could add torrential rain to the bitter temperatures and wind. Emboldened by their opener, Hearts sought a second. Robinson's glancing header drifted wide, while Arvydas Novikovas contrived to lash over from six yards.

That profligacy was punished as a lively cup tie approached the hour-mark. Zaliukas dallied on the ball while last man and, in treacherous conditions, the waspish McNulty pinched possession. Through on goal one, would have forgiven the young striker for a moment of rash finishing. Instead, McNulty provided an elegant finish.

Following his blunder, the Lithuanian rushed to pick the ball from the net with purpose. Within 20 minutes he had fulfilled that purpose – and some. Zaliukas restored the hosts lead with 15 minutes to play, scrambling home from close range following a poorly defended corner-kick.

Minutes later as he rose at the back post to head in a Ryan Stevenson delivery, relegating memories of his earlier indiscretion to the back of supporters' minds.