(Reuters) - Wells Fargo & Co (>> Wells Fargo & Co), the biggest U.S. residential mortgage lender and a major lender to the energy industry, reported a slight dip in quarterly profit on Friday as it set aside more money to cover bad loans to oil and gas companies.

Walls Fargo - whose latest balance sheet showed it had replaced Citigroup Inc (>> Citigroup Inc) as the third-largest U.S. bank - managed to increase revenue from mortgage banking for the first time in three quarters in the three months ended Dec. 31.

But its exposure to energy loans meant provisions for credit losses jumped by about $346 million (241.78 million pound) from a year earlier to $831 million. Of the increase, about $159 million was mainly for oil and gas loans.

In the fourth quarter alone, the bank's wholesale division set aside $90 million more for bad loans than in the third quarter, primarily for loans to energy companies.

Citigroup, which also reported on Friday, said it set aside about $250 million in the period to cover energy-related losses.

Wells Fargo has one of the largest exposures to the energy sector among U.S. banks, with loans to the industry accounting for 1.9 percent of its loan portfolio, according to Barclays.

Still, commercial and industrial lending, which includes loans to oil and gas firms, rose 10.3 percent in the quarter.

Wells Fargo's shares, which lost about 1 percent in 2015, were down 3.2 percent at $49 in morning trading, falling along with those of other banks amid another rout in oil prices.

MORTGAGE BANKING STRONG

Wells Fargo's mortgage banking revenue rose 9.6 percent to $1.66 billion in the quarter compared with a year earlier, and the bank made $47 billion of home loans, up 7 percent.

U.S. home sales in 2015 were best since before the financial crisis, while distressed sales – foreclosures and short sales – continued to decline, according to a report issued in December by mortgage giant Freddie Mac (>> Federal Home Loan Mortgage Corp). (http://bit.ly/1mUTrOJ)

Housing is expected to continue to perform strongly over the next two years despite rising interest rates because of years of pent-up demand and a stronger labour market, the report said.

JPMorgan Chase & Co (>> JPMorgan Chase & Co.), the No. 2 U.S. residential mortgage lender, reported on Thursday that its revenue from mortgage banking fell 10.4 percent in the quarter.

Wells Fargo's quarterly net income applicable to common shareholders slipped to $5.34 billion, or $1.03 per share, from $5.38 billion, or $1.02 per share, a year earlier.

Analysts on average had expected earnings of $1.02 per share, according to Thomson Reuters I/B/E/S.

Total revenue rose 0.66 percent to $21.59 billion, while non-interest expenses slipped about 2 percent to $12.40 billion.

Net interest income, a measure of the interest received from loans after paying for funding and accounting for potential loan losses, rose 0.58 percent to $10.76 billion.

The bank's total loans grew 6.3 percent in the quarter, with the acquisition of GE's commercial lending and leasing assets alone adding about $32 billion to the bank's portfolio.

Net loan charge-offs in the bank's commercial and industrial business, which includes lending to energy sector, rose to $215 million from $122 million in the third quarter.

(Reporting by Sruthi Shankar and Richa Naidu; Editing by Ted Kerr)

By Sruthi Shankar and Richa Naidu