The late Joan Edwards, a very private woman described by neighbours as an old-fashioned “Victorian lady”, would doubtless have been horrified at the row caused by her final wishes.

But her instructions, drawn up in the distant days when Tony Blair’s government was at the peak of its popularity, have left the Conservatives and Liberal Democrats facing accusations of greed after they pocketed £520,000 apparently left by the retired nurse to the public purse.

In the face of charges of “stealing off an old lady”, the Coalition parties hurriedly succumbed to growing criticism and returned their unexpected, but short-lived, windfalls.

Download the new Independent Premium app Sharing the full story, not just the headlines

The storm caught up Dominic Grieve, the Attorney General, and left the Bristol solicitors’ firm which drew up Miss Edwards’s will besieged by the media. When the Electoral Commission published its latest figures for party donations on Tuesday, one name stood out amid the usual union support for Labour and City financiers’ gifts to the Tories. A Joan LB Edwards was listed as the biggest individual donor to both the Conservatives and the Liberal Democrats in the second quarter of 2013, with the Tories receiving £420,576 and the Liberal Democrats £99,423 from her estate.

Both parties said she had directed her bequest be paid to “whichever party” was in power when she died and explained that the solicitors acting as her executors had divided the cash in proportion to the parties’ number of ministers and MPs. They added that the funds were received after advice from the Attorney-General’s Office and Treasury solicitors.

That version of events unravelled when the Daily Mail tracked down the woman behind the mysterious bequest and obtained a copy of her will. It turned out that Miss Edwards was a 90-year-old spinster who had lived in the same semi-detached Bristol council house from 1931 to last September, when she died. It emerged that she instructed that her £500,000-plus legacy be paid to “whichever government is in office at the date of my death for the government in their absolute discretion to use as they may think fit”.

As there was no mention of money going to a political party, the inference was that Miss Edwards wanted her lifetime’s savings to be used for the national good rather than electioneering.

The disclosure was seized on by Labour. The shadow Defence Secretary Jim Murphy said the episode looked as “dodgy as hell”, while several Tory MPs urged the return of the money.

This morning the Liberal Democrats bowed to the pressure and announced they would hand back Miss Edwards’s money. Minutes later, the Conservatives followed suit.

The money will now go to the Treasury to “pay down the national debt”. David Cameron said this would meet the spirit of what Miss Edwards intended.

Their retreats left the spinster’s solicitors, Davis Wood, facing questions over why they had handed her bequest to the Coalition partners rather than the Treasury.

After refusing to comment for several hours, the firm released a statement which insisted she had wanted the cash to be paid to a political party and not the nation’s coffers.

“The will was drafted by a solicitor at Davis Wood in 2001,” it said. “At the time of the instructions received from the late Miss Edwards, the solicitor specifically checked with Miss Edwards about the unusual nature of her proposed bequest and it was confirmed by Miss Edwards at the time of her instruction that her estate was to be left to whichever political party formed the government at the date of her death.”

Its statement raised further questions. If she was so clear about her wishes, why was that not reflected in the precise wording of her will?