The company at the heart of the debacle during last year's elections for the Holyrood and local elections has been forced to hand back more than £360,000 in compensation to local authorities.

It was revealed yesterday that eight councils had chosen to invoke penalty clauses against DRS, the private firm operating the elections, and that these had involved total compensation of £362,998.

The firm, which supplied the counting machines at last year's Scottish elections, should provide a refund for its "failure" MSPs were told yesterday.

Keith Brown, the SNP MSP for Ochil who has pursued the issue said some councils had already received compensation from DRS over problems with the ballot.

There were 146,099 parliamentary ballot papers rejected in last May's Holyrood vote and SNP back bencher Mr Brown raised the issue during First Minister's Questions.

"The company, DRS, which manifestly failed to provide the service that it was contracted to, should be obliged to further and properly rebate local authorities and the Scottish Government for their failure," said the Ochil MSP.

Mr Brown claimed earlier this month that in total the 2007 Holyrood and local government elections had cost £39.26m - compared with £17.5m in 2003.

He claimed at the time that almost £9m went to DRS. Mr Brown said he obtained the information through parliamentary questions and queries to local councils under the Freedom of Information Act.

He also yesterday called on the Scotland Office to transfer responsibility for the elections to the Scottish Government for having "failed" in its role last year.

First Minister Alex Salmond replied in parliament that the company had already paid out. "I understand a number of local authorities have successfully pursued compensation by invoking penalty clauses contained in their individual contracts with DRS," he said.

The First Minister also backed a recommendation in the report by Canadian elections expert Ron Gould into last year's poll that Holyrood should have responsibility for Scottish elections.

Edinburgh secured a rebate of more than £100,000 from the process, while East Dunbartonshire and East Renfrewshire each claimed back more than £30,000.

Perth and Kinross was another big claimant, at £46,000, as was South Lanarkshire at almost £40,000 and West Lothian at £53,000.

Some major authorities such as Glasgow, Renfrewshire, West Dunbartonshire and East Ayrshire did not lodge claims.