Despite a challenging trading environment in the final stretch of 2015, JPMorgan Chase & Co. (NYSE:JPM) posted better-than-expected quarterly profits Thursday, eking out earnings of $1.32 a share. Analysts surveyed by Thomson Reuters had projected earnings of $1.25 a share. 

The results, which ring in the quarterly earnings season for major banks, reflect ongoing cost cutting at the nation's largest bank by assets. Employees in the investment banking division saw total salaries and bonuses fall by $1.1 billion as investment bank revenue continued to slip.

Headcounts were also significantly diminished. The bank reduced payrolls by 12,000 employees over the course of 2015, with a total of 43,000 positions shed since 2012. Major banks have engaged in significant cost reduction exercises as financial regulations increase the cost of doing business. 

Consumer banking showed strong growth, with profit up $228 million over the same quarter in 2014 on higher deposits and, in late December, a pickup in interest margins thanks to the Federal Reserve's interest rate hike. Yearend earnings totaled a record $24.4 billion. 

Gains in the consumer division helped even out losses from trading, which suffered across the industry as markets grew queasy over slowing global growth in the second half of last year. Revenues from bond trading fell 3 percent to $2.6 billion. Asset management revenues fell 4.8 percent to $3 billion. 

"The consumer business continues to gather deposits, outpacing the industry," said chief executive Jamie Dimon in a statement. "Markets were somewhat quieter, and we saw the impact reflected in the results of our trading and Asset Management businesses.”

The lender's legal costs fell to $644 million for the quarter, down from $990 million the year before. Nearly half of that bill stemmed from a settlement in December over failures to disclose conflicts of interest to JPMorgan's wealth management clients.

JPMorgan shares rose 2.4 percent in premarket trading.