The firm confirmed the credit was added to its accounts but declined to confirm reports it totalled £20 million.
The revelation came as the UK government pledged to “come down like a ton of bricks” on energy companies which have stockpiled an estimated £2 billion from customers’ building up large amounts of credit from direct debits.
An unnamed whistleblower claimed a special British Gas team was set up to reduce the six-year period the firm held customers’ credit for before using it to boost its income.
This was built up by home and business customers using less energy than they had been billed for.
Shadow energy secretary Caroline Flint condemned the practice as “simply not acceptable”.
She said: “If companies can’t find customers to repay them, they should use this money to keep bills down or help other vulnerable customers, not boost their profits.”
British Gas, which has 800,000 customers in Scotland among 10 million in the UK, was unable to say how many former customers north of the Border were owed money.
Meanwhile, energy minster Greg Barker promised action against energy firms which failed to refund large credit balances to their customers.
He said: “Customers will rightly feel outraged that they signed up to direct debit payments for cheap tariffs but instead find their cash stockpiled.
“We need to stamp this out now and energy firms must come clean on how much cash they are sitting on.
“If we find serious abuse, rest assured we will come down on them like a ton of bricks.”
Watchdog body Consumer Futures urged consumers to check how much energy they were using to ensure they were not overpaying.
Scotland spokeswoman Annie Gill said: “We recommend consumers regularly contact their supplier with their own meter reading to ensure they pay the correct amount, particularly if they receive an estimated bill. Whilst it is usual for consumers paying by monthly direct debit to be in credit in the spring and summer months to smooth out higher winter bills, suppliers must ensure monthly charges accurately reflect customers’ energy use.”
Ms Gill said customers could request a credit refund at any time, and they had the right to refuse an increase in their direct debit if they felt it was too high.
She said regulator Ofgem must also ensure suppliers did not charge more than they should. A British Gas spokeswoman said: “We make every effort to track down any customer who has left British Gas and has credit with us so that it can immediately be returned to them.
“If, after every reasonable effort, we are unable to return the credit to them, it is accounted for in our audited accounts as per standard industry processes. If a customer subsequently contacts us, we will always issue any credit owing to them.”