Wells Fargo & Co. agreed Friday to pay a massive $3 billion penalty and to accept a three-year deferred prosecution agreement to avoid a criminal trial over its fake bank account scandal.

CEO Charles Scharf issued a statement saying, “The conduct at the core of today’s settlements—and the past culture that gave rise to it—are reprehensible and wholly inconsistent with the values on which Wells Fargo was built.”