A flaw in a US bank's computer software led to 625 customers not receiving government loan assistance to which they were entitled - and 400 of those went on to lose their homes.

The government scheme was designed to help people struggling to pay their mortgages.

Wells Fargo told CNN Money there was no "clear direct cause and effect relationship" between the error and the loss of homes.

However, compensation is being offered.

The bank has set aside $8m (£6m) to compensate those affected by the software error, which existed between April 2010 and October 2015.

Wells Fargo revealed the information in its latest quarterly financial report and said there were continuing efforts to identify other customers who might have also been affected.

The bank is the third largest in the US.

In April 2018, it was fined $1bn by two US regulators to resolve investigations into car insurance and mortgage lending breaches.

It did not admit to any wrongdoing.