The Consumer Financial Protection Bureau, the US government’s top consumer watchdog, and a government bank regulator hit Wells Fargo with a $1 billion fine on Friday for improperly charging thousands of customers for auto insurance they didn’t need — it’s the agency’s second-largest fine in its history and its first enforcement action since Mick Mulvaney took over as acting director in November.

While Wells Fargo would certainly rather avoid the penalty, it’s not going under because of it, either: The bank is expected to make $3.7 billion from the Republican tax bill this year, which is nearly four times what the CFPB fined them.

Wells Fargo agreed to pay $1 billion to the CFPB and the Office of the Comptroller of the Currency (OCC), a bank regulator, for both the initial offense and to lock in low mortgage rates. The bank has faced numerous penalties in recent years for its bad behavior; some of its practices and business areas, such as a foreign-exchange trade dispute and recommendations made by its wealth division, are still under scrutiny.

It was fined $185 million in September 2016, including $100 million by the CFPB under Mulvaney’s predecessor, Richard Cordray, for issuing millions of fake credit card accounts over a span of years. The Federal Reserve in February said the bank wouldn’t be allowed to get any bigger until it cleans up its act and pressured it to remove some members of its board of directors.

Wells Fargo’s wealth management business is reportedly under investigation for sales practices similar to what happened with the fake credit card accounts, and the Justice Department is probing its currency trading business.

The San Francisco-based bank has repeatedly apologized for its repeated misdeeds. “Our customers deserve only the best from Wells Fargo, and we are committed to delivering that,” CEO Timothy Sloan said in a statement on Friday.

In the same statement, the bank reported it was revising its first-quarter earnings to reflect the CFPB’s penalty, saying it had earned $800 million less during the first three months of the year. Wells Fargo, of course, still brought in $4.7 billion. And thanks to the Republican tax bill passed in December, it’s about to make a lot more.

The Republican tax cuts are better for Wells Fargo than the other big banks

The Republican tax bill, passed in December, slashed the corporate tax rate to 21 percent from 35 percent and is a big boost to corporate America and the wealthy. It’s been good for all the banks — according to an Associated Press analysis, the six biggest banks in the United States saved $3.6 billion during the first quarter of the year alone, thanks to the tax bill.

Over time, however, it looks like Wells Fargo is poised to be the biggest winner of all: According to a Goldman Sachs report from December, the tax cut will boost Wells Fargo’s profits by $3.7 billion this year. That’s more than Bank of America Citibank, JPMorgan, Morgan Stanley, PNC Financial Services, and UBS. (The Goldman report doesn’t include its own tax cut profit boost.)

Goldman estimates that Wells Fargo’s earnings will jump by 18 percent thanks to the GOP bill and see its effective tax rate — what it actually pays — drop from 33 percent to 22 percent. Because Wells Fargo derives nearly all of its profits from the United States it makes out best under the new tax regime.

In other words, even after the CFPB’s $1 billion fine, Wells Fargo is still up about $2.7 billion.

Wells Fargo was one of the first companies to do pull the tax cut PR stunt

Right after Republicans passed their tax bill in December, a number of companies delivered public thank-yous with a series of bonus and investment announcements they said were pegged to the legislation. Wells Fargo was one of the first to do so. It announced plans to donate $400 million to nonprofit organizations and expand other philanthropic efforts and said it would raise its minimum pay to $15 an hour. (Wells Fargo’s CEO made $17.6 million last year.)

“We believe tax reform is good for our US economy and are pleased to take these immediate steps to invest in our team members, communities, small businesses, and homeowners,” Sloan said in a statement.

As with so many of the tax cut-pegged corporate announcements, Wells Fargo’s goodwill was not what it seemed. In January 2017, the bank announced it was lifting its minimum wage to $13.50 to $17 per hour — before Donald Trump had even been inaugurated. Moreover, when the bank reannounced its wage hike in December, a spokesperson initially told the LA Times the wage increase was not tied to the tax bill, only to later backtrack and say it was.

When I asked Wells Fargo about its tax bill win in December, Ancel Martinez, head of corporate communications, told me that Wells Fargo is “one of the largest corporate taxpayers in the US” and is a “responsible corporate citizen.” And to be fair, it’s not Wells Fargo’s fault its tax bill dropped (though it and the other banks spent millions of dollars on lobbying as Congress debated it). Washington lawmakers wrote and passed the legislation, and the bank is now just following the law.

But the bank has wronged its customers time and time again and has consistently managed to come out ahead. The same day the CFPB announced the $1 billion fine on Friday, Wells Fargo’s stock price climbed almost 2 percent.