Wells Fargo & Co. hasn't yet fixed all of its problems, but at least it stopped its revenue slump.

The bank posted a surprise increase in revenue, with the figure rising to $21.9 billion in the third quarter, after analysts expected a slight decline. The bank benefited from rising interest rates and saw growth in consumer-lending originations in areas such as auto and personal loans, it said in a statement Friday.

It's the first time this year revenue has grown and may indicate that Chief Executive Officer Tim Sloan's efforts to turn Wells Fargo around are paying off. The lender has posted muted results in the wake of a series of consumer scandals that erupted in 2016 when the bank disclosed it may have opened millions of accounts on behalf of customers who didn't want them, and the Federal Reserve has prohibited Wells Fargo from increasing assets until missteps are fixed to the regulator's satisfaction.

Wells Fargo "has been able to put a number of the scandals it has been plagued by behind it," Octavio Marenzi, CEO of capital-markets management consultancy Opimas, said in an email. Third-quarter earnings "look solid overall -- good interest margins, and low charge-offs. A cloud on the horizon is the bank's slip in deposits, which have declined by 3 percent. So far, the bank has been able to keep net-interest income increasing."

Shares of San Francisco-based Wells Fargo climbed to $52.20 at 9:26 a.m. in early New York trading. They closed at $51.44 on Thursday and have dropped 15 percent this year, compared with a 5.1 percent decline in the KBW Bank Index.

"We saw positive business trends in the third quarter, including growth in primary consumer checking customers, increased debit and credit card usage, and higher year-over-year loan originations in auto, small business, home equity and personal loans and lines," Chief Financial Officer John Shrewsberry said in the statement.

Still, net income rose less than analysts expected. It climbed to $6 billion, or $1.13 a share, missing the $1.18-a-share average estimate of 28 analysts in a Bloomberg survey.

Average deposits at Wells Fargo fell to $1.3 trillion, down $40 billion from a year earlier, as "consumers continued to move excess liquidity to higher-rate alternatives," the bank said. Total average loans fell to $939.5 billion, down $12.9 billion, or 1 percent, the lowest level in more than two years.

The drop shows that Wells Fargo is still struggling to bounce back from the consumer scandals it has been working through over the past two years. By comparison, JPMorgan Chase & Co. saw an increase in both categories. At a September investor conference, Shrewsberry attributed the drop in loans to competition across consumer and commercial categories.

Wells Fargo's provision expense and net charge-offs both fell from a year earlier, as they did at JPMorgan. Improvement of the metrics across the biggest consumer banks suggests there is still life to the current credit cycle, even as many across the financial system question how long the expansion can last.