Wells Fargo will pay $24 million to settle allegations that it mistreated members of the military -- including illegally repossessing their cars.

The bank, already reeling from a scandal over fake accounts, will pay $4.1 million to settle Justice Department charges that it seized 413 cars owned by service members without a court order, a violation of federal law.

The Justice Department said the illegal repossessions took place from 2008 to 2015. The first complaint came from an Army National Guardsman in North Carolina who said the bank seized his car while he was preparing to deploy to Afghanistan.

Wells Fargo then auctioned his car and tried to collect a balance of $10,000 from his family, the Justice Department said.

The bank will pay $10,000 to each of the affected service members, plus lost equity in the cars with interest, and repair their credit.

Related: Wells Fargo worker retaliation claims rile up Congress

The bank was fined $20 million more by the Office of the Comptroller of the Currency for breaking three provisions of the same law by denying members of the military certain banking protections, including capping their interest rates at 6%. Those violations began in 2006, the OCC said.

Wells Fargo said in a statement that it apologizes for not living up to its commitment of ensuring that all service members "receive the appropriate benefits and protections."

"We have been notifying and fully compensating customers and will complete this work in 60 days," the company said.

Related: Lawmakers say Wells Fargo is like a 'criminal enterprise'

News of the penalties came as Wells Fargo and CEO John Stumpf faced the wrath of the House Financial Services Committee at a hearing about the millions of fake bank and credit card accounts, plus claims that it retaliated against whistleblowers.

The company is also facing lawsuits from shareholders, former employees and customers.