Henry McLeish first took control of the offices in Hanover Court, Glenrothes, shortly after he was elected to Westminster as an MP in 1987.

The offices, Mr McLeish said, were far too big and so he decided to sublet the first floor.

But crucially, he forgot to declare the income from the sub lets when he claimed his office expenses from Westminster.

The original newspaper story said Mr McLeish had received rent for 5 years from a firm of solicitors, Digby Brown.

Mr McLeish rushed to register the sub let with the Commons authorities, but within days the Conservative's then spokesman on Scottish affairs, Dominic Grieve, had written to the Commons Commissioner on Standards, Elizabeth Filkin.

The story first appeared in a newspaper in April

Mrs Filkin referred the matter to the Westminster parliament's fees office, and her involvement then ceased, because the general election was called, and Henry McLeish was no longer an MP.

The story lay dormant for some months, but resurfaced late in October.

Suddenly the story was live again and it was not long before the issue made its way into the debating chamber in the Scottish Parliament.

Time and again Henry McLeish and his supporters have tried to control the story, but each time Mr McLeish and his advisers tried to kill the story, it only seemed to make things worse.

Such failed attempts culminated in a disastrous performance on BBC Question Time.

Yellow dossiers

Another nail in the coffin was hammered home on Tuesday, when in a last ditch attempt to stop the story, the first minister held a series of press briefings, handing out yellow dossiers of information.

It contained details of 14 years of sub lets at Mr McLeish's office, worth over £36,000.

Again, Mr McLeish tried to smooth over the problem by putting his hand in his pocket.

He may yet be repaying £27,000 and Mr McLeish will soon be moving out of the first minister's official residence in Edinburgh.

Elizabeth Filkin referred the matter to Westminster's fees office

But despite his resignation he is unlikely to escape further investigations into what he called his "fatal mistake".

On Wednesday night Mr McLeish cancelled all his official engagements, to work on a speech for Thursday morning's debate.

However, that debate never came to pass as the outgoing first minister decided to "take full, personal responsibility" for the Officegate affair that had dogged him for the past fortnight.