Spencer Platt/Getty Images

Bank of America on Wednesday became the latest large bank to report second-quarter financial results that exceeded Wall Street’s expectations.

The bank benefited from higher revenue from equities sales and trading and a reduction in expenses, but its mortgage unit continued to struggle.

“We are doing more business with our customers and clients, and gaining momentum across every customer group we serve,” Brian T. Moynihan, the bank’s chief executive, said in a statement. “We must keep improving, but with the consumer recovering and businesses strong, we have lots of opportunity ahead.”

Net income rose 63 percent, to $4 billion, or 32 cents a share, compared with $2.5 billion, or 19 cents a share, in the period a year earlier, while revenue increased to $22.7 billion from $22 billion.

Analysts had been expecting second-quarter earnings of 25 cents a share, according to Thomson Reuters.

Despite the rise in earnings, investors might question the strength of the quarter.

While revenue rose, much of the increase came from Bank of America’s Wall Street businesses, whose performance can be uneven over longer periods. Profit also received a lift from lower expenses. The bank paid substantially less interest on its own borrowings, compared with the second quarter of 2012. It also set aside less for its bad loan reserve and spent substantially less on mortgage litigation expenses.

Some analysts said they thought the bank performed relatively well in the quarter but still needed to make further progress.

“This was a quarter in which Bank of America executed on the strategies it has laid out,” said Shannon Stemm, a banking analyst at Edward Jones. “But it’s still got work to do.”

A major challenge is to achieve strong profit growth when gains in revenue are minimal. Cost-cutting is one way to do that. “A lot of this is about expenses,” said Richard Ramsden, a banking analyst at Goldman Sachs. “People really want to see revenue stabilize and expenses drop.”

Investors have long been concerned about the expense of dealing with past-due mortgages. But on Wednesday Bank of America said it expected such costs to decline more quickly, as the number of past-due home loans falls.

Cutting costs can go only so far, so Bank of America also needs to find ways to generate some revenue growth.

Part of the problem is Bank of America’s conflicted relationship with mortgages after the financial crisis. It was inundated with bad loans it inherited after it acquired Countrywide Financial in 2008Ö, and it was late to participate in the latest mortgage refinancing boom, which was a big source of revenue for many banks. Since the crisis, Wells Fargo has become the predominant mortgage bank, making it difficult for rivals to regain their pre-crisis foothold.

Bank of America wants to increase its share of the mortgage market, and though it made some gains in the second quarter, the market challenges were apparent.

Even though it originated more mortgages in the quarter than it did in the period a year earlier, revenue from making home loans fell. The financial gain that banks make from selling mortgages to government entities has fallen, which hurts mortgage revenue. The amount of refinancing has dropped off as interest rates have climbed. As a result, banks hope borrowers will take out more original mortgages if the housing recovery continues, but this business is still relatively quiet.

With consumer businesses lackluster, Bank of America had to rely on Wall Street for growth.

Fees from advising on mergers and acquisitions and underwriting stock and bond deals were up. Managing money for wealthy individuals was also strong. At the Merrill Lynch Wealth Management unit, revenue rose 10.5 percent, to $3.74 billion.

Wall Street businesses can be volatile, though. That was apparent in Bank of America’s trading results. Revenue from trading stocks rose about 60 percent, to $1.2 billion. But the fixed-income unit, which trades bonds, currencies, commodities and derivatives linked to those assets, did not fare as well. Its revenue fell 5 percent, to $2.3 billion.

In a news release, Bank of America said fixed-income results were affected by the sell-off in bonds that took place in the second quarter after the Federal Reserve said it was contemplating reducing its stimulus policies.

Bank of America also provided estimates of how it would fare under a proposed rule that focuses on capital, the financial buffer that banks are required to maintain to absorb losses.

Investors are fixated on this issue right now, fearing that the largest banks might have to raise large amounts of new capital to comply with the rule.

But Bank of America might already meet the requirements, according to estimates the bank provided on Wednesday. The rules require a so-called leverage ratio of 5 percent at a bank’s holding company.

Bank of America estimated on Wednesday that its leverage ratio would be 4.9 to 5 percent at its parent company. The proposed rules also require a 6 percent ratio at banking subsidiaries that are covered by federal deposit insurance. Bank of America’s chief financial officer, Bruce R. Thompson, said during a news briefing on Wednesday that he thought the two largest subsidiaries already had enough capital to comply with the 6 percent requirement.

Bank of America shares rose 2.8 percent, to $14.31, suggesting that investors were pleased with the results. Mr. Ramsden, the Goldman analyst, said the market was keen to see stable revenue, lower costs and strong indications that the bank had built up sufficient capital.

“They are doing all three,” he said. “The debate is going to be, Are they moving fast enough?”