Wells Fargo & Co., the U.S. lender under fire from regulators and customers over abusive sales practices, posted its biggest quarterly profit increase in four years after taking a $3.35 billion gain related to passage of the U.S. tax law in December.

Net income rose 17% to $6.15 billion, the San Francisco-based bank said Friday in a statement. Earnings per share slid to $1.16, missing analysts' average estimate of $1.23 in a FactSet survey.

Wells Fargo and its CEO, Tim Sloan, have acknowledged that the sales-practices scandals are taking a toll on profit margins, party due to increased costs to address regulators' concerns and resolve related lawsuits. Billionaire Warren Buffett's investment company Berkshire Hathaway Inc. (BRK.A) - Get Report  is the bank's biggest shareholder, with a stake of about 9.4%, according to FactSet. 

The bank has had to back off from its decade-long "cross-selling" strategy within the consumer bank in which employees were encouraged to push extra banking products on clients; as a result, the number of internal customer referrals for products like mortgages, home-equity loans and credit cards has declined.

The bank had to record additional costs in the quarter related to the fallout from the scandal and other matters, according to Wells Fargo's statement. Those came in the form of "litigation accruals," essentially setting aside more money to cover regulatory matters and lawsuits. 

Non-interest expenses nearly tripled to $3.5 billion in the fourth quarter, "primarily related to litigation accruals for a variety of matters, including mortgage-related regulatory investigations, sales practices and other consumer-related matters." 

"While we faced challenges in 2017, we are a much better company today than we were a year ago," Sloan said in the statement. "The progress we made over the past year was evident in the fourth quarter in higher deposits, loan growth -- particularly in commercial loans, increased debit and credit card transactions -- and record client assets under management" in the wealth and money-management division.

Even so, the pace of loan growth at Wells Fargo was slower than some analysts had expected, a worrisome sign. Loans grew at an annualized rate of just 2.1% during the quarter, less than half the 4.5% pace expected by analysts at Keefe, Bruyette & Woods, according to a report Friday from the brokerage firm.

"Loan growth was positive, but that may not be enough to offset the negative sentiment around the litigation accrual," the KBW analysts wrote. 

Wells Fargo's stock price slid 0.6% to $62.61 a share as of 11:28 a.m. Friday. 

The fourth-quarter results were bolstered by a $3.89 billion gain from writing down so-called deferred tax liabilities, due to the new law's reduction in the corporate rate to 21% from 35%, Wells Fargo said. Such liabilities represent money that Wells Fargo still owed to U.S. tax collectors from past years that now will likely never have to be paid. Thus, the write-down results in a profit gain that the bank can now use for dividends to shareholders, stock buybacks or new business investment.

The gain was offset by a $370 million after-tax loss from "adjustments related to leveraged leases, low-income housing and tax-advantaged renewable energy investments," due to the new tax law, the bank said. Another $173 million expense came from the estimated impact of repatriating foreign earnings.

The bank also had to record an extra tax cost of $1 billion in the quarter due to items that are not deductible, primarily the litigation accruals, according to the statement.

Wells Fargo expects an effective tax rate of 19% in 2018, up from 18.1% in 2017.  

In September 2016, the lender agreed to a $185 million settlement with federal and local regulators over the creation of more than 2 million unauthorized customer accounts from 2011 through 2015 by workers trying to meet their quotas. The scandal led to regulatory fines, criticism from U.S. lawmakers and eventually the departure of former CEO John Stumpf. The company has also shaken up its board of directors, purging some long-serving members who failed to stop the company's aggressive sales practices.

Sloan, who took over from Stumpf, led an expanded review that included 2009 and 2010 revealed as many as 1.5 million additional unauthorized accounts. The bank has also acknowledged erroneously charging some 490,000 car-loan customers for insurance they didn't need.

More of What's Trending on TheStreet: