The Renfrewshire North and West MSP was perhaps the most senior member of the Government apart from Ms Sturgeon and Deputy First Minister John Swinney.
The bookies’ frontrunner to be the next First Minister, he was widely seen as one of the most able and capable ministers in the Scottish Cabinet.
Ms Sturgeon has insisted she’s not going anywhere in response to speculation about her future, but it would seem that justice secretary Humza Yousaf now has a clear run at the top job – should it one day become available.
The immediate headache for Ms Sturgeon is who to fill the breach as new finance secretary – one of the most important and responsible roles in Government given the suite of tax new powers that are now presided over at Holyrood.
Public finance minister Kate Forbes did her hopes no harm after a strong and polished performance at Holyrood yesterday, stepping into the breach to deliver the Budget in Mr Mackay’s absence.
Widely seen as a rising star of Scottish politics, she won plaudits recently from the business community after blocking unpopular plans to hand control of rates over to councils.
But at 29 and having only become a minister a year-and-a-half ago, she may be deemed to lack the experience required for the one of the most challenging and high-profile roles in the Scottish Government.
It may be that Ms Sturgeon could look to promote a junior minister such as Paul Wheelhouse, who has the energy brief, into the role or possibly shift Michael Matheson from transport.
Universities minister Richard Lochhead, who has nine years of experience as a Cabinet secretary, could also be a contender.
The dilemma Ms Sturgeon faces is that whoever is appointed will not just be presiding over the devolved public finances under the constitutional set-up at Holyrood.
This needs to be someone who can sell the economic case for independence as the Scottish Government demands the right to hold a second referendum on leaving the UK.
Mr Mackay sat on the SNP’s Growth Commission, which set out a financial blueprint for independence and had already tasked civil servants with drawing up an “alternative” to the controversial Government Expenditure and Revenue in Scotland (GERS ) figures, which set out the deficit that Scotland runs inside the UK.
Mr Mackay had pledged his new paper would present the opportunities of independence.
The economic argument was where the Yes campaign fell down in 2014 and the new finance secretary will play a critical role in convincing voters that Scotland is strong enough to go it alone economically after independence if a referendum is to take place in the next year.
And, of course, this shock resignation for Ms Sturgeon comes just a month before her predecessor and mentor, former first minister Alex Salmond, is scheduled to go on trial where he faces a string of sexual assault charges after ten women brought complaints against him.
Salmond denies all wrongdoing.
The fallout from the Mackay case, with opposition parties demanding his departure as an MSP, could well drag out over coming weeks.