The largest U.S. bank by assets showed strength across its businesses in the first quarter, driven by what Chief Executive Jamie Dimon described as solid U.S. economic growth, moderate inflation and strong consumer and business confidence.

U.S. bank stocks have underperformed the broader market in recent months on fears of an impending recession, with economists and investors citing concerns over a flattening yield curve and slowing housing market. But bank executives have downplayed concerns, pointing to continuing loan growth.

"There is no law that says it has to stop," Dimon said when asked if the decade-long economic expansion is due to turn into a recession. "I wouldn't count on there having to be a recession in the short run."

Loans in JPMorgan's consumer banking division rose 4 percent from a year ago. Overall revenue rose 4.7 percent to $29.85 billion (22.84 billion pounds). Analysts had expected revenue of $28.44 billion, according to IBES data from Refinitiv.

"We've been generally quite optimistic about the outlook for the economy," Chief Financial Officer Marianne Lake told reporters on a call to discuss the results. "It doesn't diminish the fact that there are a number of risks out there. Right now we don't see that playing out in the data."

The bank's net interest margin, a key measure of loan profitability, edged up only 0.02 percent point from the fourth quarter, a slower pace of improvement than in the two previous quarters.

Investors have been concerned that net interest margins may have peaked for the banks, since the Federal Reserve has signalled it is unlikely to raise short-term rates this year and the spread between short- and longer-term rates has narrowed.

While Lake did not directly answer if the lending spread had peaked after fuelling profit growth for years, she said it will likely not get any better in the coming quarters. The bank expects it to remain constant, she said.

Unlike Wells Fargo & Co, the other big U.S. bank to report earnings on Friday, JPMorgan stood by its outlook for net interest income, a key driver of profits, which it expects to increase about 4 percent this year over 2018.

Wells said it now expects its NII to decline 2 to 5 percent instead of landing in a range of plus or minus 2 percent. The change sent Wells shares down as much 2.4 percent. Lake also reiterated the bank's 17 percent projection for return on average tangible common equity and said she does not anticipate the bank will raise it this year.

Lake downplayed questions about whether the bank's $90 million provision for credit losses in its commercial banking segment in the first quarter was a reason for concern.

"These downgrades were idiosyncratic. It was a handful of names" of diverse commercial and industrial borrowers, she said. "We are not seeing signs of deterioration."

In the bank's capital markets business, equity underwriting fell 13 percent and bond trading revenues fell 8 percent from the year-ago quarter. Bank executives had signalled earlier in the quarter that capital markets revenue could fall by a greater amount.

Shares of the bank were up 3.6 percent in morning trading.

The bank said net income rose to a record $9.18 billion, or $2.65 per share, in the quarter ended March 31, from $8.71 billion, or $2.37 per share, a year earlier.

Net interest income rose 8 percent to $14.60 billion, boosted by interest rate increases since the first quarter of last year.

Analysts had estimated earnings of $2.35 per share, according to IBES data from Refinitiv.

(Additional reporting by Siddharth Cavale in Bangalore and Matt Scuffham in New York; Editing by Sriraj Kalluvila; Neal Templin, Jonathan Oatis and Richard Chang)

By Elizabeth Dilts and David Henry