Bank of America Corp. posted a 40 percent surge in first-quarter profit, fueled by stronger trading revenue, and added employees for the first time in more than five years as Chief Executive Officer Brian Moynihan expressed optimism about the U.S. economy.

Fixed-income trading revenue rose 29 percent to $2.93 billion, the second-biggest U.S. bank said Tuesday in a statement, beating analysts’ $2.6 billion average estimate. Equity trading revenue also was better than expected, climbing 7.4 percent to $1.1 billion.

“The U.S. economy continues to show consumer and business optimism, and our results reflect that,” Moynihan said in the statement. Bank of America added 549 employees in the quarter, the first increase since the third quarter of 2011.

Last week, JPMorgan Chase & Co. and Citigroup Inc. also reported robust first-quarter revenue from bond trading. JPMorgan, the largest U.S. bank by assets, posted a 17 percent gain in fixed-income trading revenue, while Citigroup generated the most revenue from that business in three years. That contrasts with Goldman Sachs Group Inc., which on Tuesday posted worse-than-expected fixed-income results.

Bank stocks have climbed since November’s U.S. election in part on expectations that Federal Reserve rate increases would boost profits. Charlotte, North Carolina-based Bank of America, which is among the most sensitive to interest-rate changes, has led the surge among the country’s biggest lenders, gaining 38 percent through Monday.

Net interest income climbed 5.5 percent to $11.1 billion from a year earlier, exceeding the firm’s forecast. Net interest margin -- the difference between what a bank charges for loans and pays depositors -- rose 16 basis points to 2.39 percentage points from the previous quarter, the biggest jump among large U.S. banks. The firm expects a $150 million increase in interest income in the second quarter from the previous three-month period, Chief Financial Officer Paul Donofrio said on a call with analysts.

Bank of America shares slid 0.6 percent to $22.68 at 10:14 a.m. in New York as global equity markets fell.

Total profit jumped to $4.86 billion, or 41 cents a share, from $3.47 billion, or 28 cents, a year earlier, according to the statement. That beat the 35-cent average estimate of 27 analysts surveyed by Bloomberg. Revenue increased 7 percent to $22.2 billion, also more than estimated. Expenses rose less than 1 percent to $14.8 billion, higher than expected, while the firm’s efficiency ratio weakened about 1 percentage point to 66.15 percent. The bank reiterated its target of $53 billion in total annual expenses by the end of 2018.

“We grew the top line, and we grew the bottom line, and we did it the right way,” Moynihan said on the call. “All of that will bode well for future growth.”

Profit from the global markets division, which houses the bank’s trading units, climbed 33 percent to $1.3 billion. Investment-banking revenue rose 37 percent to $1.58 billion, compared with analysts’ $1.41 billion estimate.

Donofrio said trading in corporate credit, special situations and mortgages fueled much of the bank’s fixed-income performance. Equities benefited from the firm’s investments in electronic trading, with strength in Europe and Asia, particularly in derivatives, he said. Cash equities declined.

Revenue from helping companies issue new debt -- spurred by expectations of more interest-rate hikes -- propelled a 38 percent rise in debt underwriting to $926 million, beating analysts’ $870 million estimate, according to the statement. Equity underwriting revenue was $312 million.

Mortgage banking fees plunged 72 percent to $122 million, the biggest decline among large U.S. banks. Fees at JPMorgan sank 39 percent, while Wells Fargo & Co., the largest U.S. mortgage lender, reported a 23 percent drop.

Profit in the consumer-banking division climbed 7.4 percent to $1.89 billion, as revenue increased 5.4 percent to $8.28 billion. The firm closed 20 branches during the quarter, bringing the total to 4,559.

Global wealth and investment-management earnings rose 3.9 percent to $770 million as client balances in the Merrill Lynch and U.S. Trust units rose to $2.59 billion. Net income beat UBS Group AG’s analyst Brennan Hawken’s estimate of $706 million.