Wells Fargo easily beat Wall Street’s third-quarter revenue forecasts as higher interest rates helped offset a steep decline in home lending.

The nation’s biggest mortgage lender brought in $19.5 billion in revenue for the period, thanks to $12.1 billion in net interest income, a 36% increase from the same period a year ago.

Wells earned 85 cents per share in the period, falling short of Wall Street’s profit projections. The company incurred $2 billion in regulatory and litigation expenses, the equivalent of a 45 cents-per-share loss. Analysts expected profit of $1.09 in the period. Wells earned $1.17 per share in last year’s third quarter.

Shares in the San Francisco bank rose about 1.2% in premarket trading.

JPMorgan Chase profits plunge as it prepares for possible recession

Wells has benefitted from the Federal Reserve’s aggressive interest rate hikes this year as the central bank tries to tamp down the highest inflation in four decades. The Fed has raised rates five times this year, including three consecutive 0.75 percentage point hikes that pushed its key short-term rate to a range of 3% to 3.25%, the highest level since 2008. Wall Street expects another large three-quarter-point hike at the Fed’s meeting early next month.

While those higher interest rates have padded Wells’ bottom line, the flip side is that fewer people are in the market for home mortgages. Wells Fargo reported that its home lending revenue fell 52% from last year, when mortgage rates were less than half of the current 6.92%.

Wells is still trying to exit the strict federal guidelines that sets its asset cap at just under $2 billion, hindering its ability to grow.

The Federal Reserve capped the size of Wells Fargo’s assets in 2018 after a series of scandals, most notably the uncovering of millions of fake checking accounts its employees opened to meet sales quotas.