Councils could be forced to refund more than £20m after overcharging the elderly for care costs, it was claimed last night, as Edinburgh accepted it owed more than £2m.

The Tories said the Scottish Executive should foot the bill, as it had issued muddled guidance on what councils could charge.

In a report going to councillors next week, Edinburgh City Council says it has been prompted into action by an independent legal opinion on the regulations governing free personal care.

Peter Gabbitas, director of health and social care, said the council should use its reserves to make a one-off payment of £2.1m to a total of 820 people. A council source added there could be a further £1m owed to others, while ending the overcharging adds new annual costs of £1m.

The council's decision flows from confusing regulations governing which aspects of personal care councils can charge for. In 2002 and 2003, the executive said councils could not charge for "food preparation and provision of meals (at home)".

However, it was acceptable to charge for "assistance with eating, assistance to manage special diets and the assistance with the preparation of specialist meals (eg pureed foods)".

On the basis of this advice, Edinburgh began charging some people for receiving meals and food preparation at home. However, in September 2004 the executive wrote to councils saying the guidance was "inconsistent" with the 2002 act introducing free personal care.

Assistance with the preparation of food was not chargeable, ministers said, and promised further guidance "in due course". This emerged in May 2006, but only added to the confusion.

Edinburgh, therefore, decided last September to commission an independent legal opinion. It now concludes that, since July 2002, when the free personal care law came into effect, the council "has not had the power to charge clients for assisting with the preparation of food".

In his report, Mr Gabbitas said: "Although the council acted in good faith, charges levied have been ultra vires. People illegally charged have a claim for repayment "

He said similar opinions had been obtained by "several other councils" and added that Edinburgh council would forward its report to the executive and ask it to "reimburse the council for this unbudgeted expenditure".

David McLetchie, Tory MSP for Edinburgh Pentlands, last night wrote to the Deputy Health Minister calling for a definitive statement on the issue.

"All Scottish councils should refund people wrongly charged. That will cost around £20m.

"Since the fault lies firmly with the Scottish Executive, it should stump up and make a special grant allocation to councils to cover the cost of refunds."

Cosla, the council umbrella group, said the Edinburgh decision did not necessarily mean all councils would have to follow suit. A spokesman urged the executive to deliver definitive "clarity" on the issue.

The executive said all councils were adequately funded to deliver free personal and nursing care. "(The 2002 Act) makes explicit that assistance with the preparation of food should not be charged for. We are aware that there are some variations in local authorities' interpretations of the act," a spokesman said.

"We have conducted extensive research into the operation of the Free Personal Care Policy. This is due to published in the coming months."