Wells Fargo has agreed to pay the state of California $8.5 million to settle a probe into its failure to tell consumers it was recording their calls.

The San Francisco company did not inform consumers in a timely manner about its automated recording of conversations, the California attorney general said in a news release Monday.

Most of the fine will be applied to civil penalties, and about $500,000 will be given to organizations that advocate for consumer privacy. Wells Fargo also agreed to improve its procedures for notifying customers about recordings.

Wells Fargo cooperated with investigators, the California attorney general said. The investigation was conducted in cooperation with the Los Angeles County district attorney and with other local prosecutors.