NEW YORK (TheStreet) -- Bank of America  (JPM) issued more new credit cards from April through June than in any three-month period since the financial crisis, showing customer confidence that the U.S. economy will continue to improve despite turmoil in Greece and China.

Customers opened 1.3 million new credit card accounts in the second quarter, an 18% gain from a year earlier and the most since the third quarter of 2008, when the subprime lending crisis took down investment banking firm Lehman Brothers and sparked a global economic meltdown. Spending on debit and credit cards increased 3% to $127 billion, Chief Executive Officer Brian Moynihan said on a conference call with analysts.

"Notwithstanding uncertainty in economies outside the United States, we see the U.S. economy continues to steadily improve," Moynihan said, noting that the bank predicts gross-domestic product growth of 3% in each of the third and fourth quarters. "In our middle-market businesses and our commercial businesses, the company's balance sheets are strong and continue to draw loans at higher rates than last quarter."

Residential mortgage and home-equity loans increased 40% from a year earlier to $19.2 billion, helping to more than double net income to $5 billion, or 45 cents a share, the Charlotte, N.C.-based bank said in a statement. Revenue climbed 1.7% to $22.1 billion, topping the average estimate of $21.3 billion from analysts in a Bloomberg survey.

Overall, the quarter was a bright spot for Bank of America, which has faced challenges in the past several years years as it grappled with stricter regulations and fallout from acquisitions during the financial crisis that eventually forced it to accept $45 billion in government bailouts. Bank of America paid $2.5 billion for subprime mortgage-lender Countrywide Financial in early 2008 and $18.5 billion for investment banking firm Merrill Lynch in September, just as Lehman Brothers collapsed.

Bank of America shares rose 2.9% to $17.63 in mid-morning trading on Wednesday, the second-best performance on the KBW Bank Index, a sharp turnaround from the stock's status as of Tuesday as the worst performer this year. 

The bank's mortgage originations increased 44% from a year earlier to $16 billion, CFO Bruce Thompson said on the call. "Although the mortgage pipeline remains solid, it is down 15% from the end of the first quarter, driven by higher rates," he added.

Credit quality in the consumer banking business, Bank of America's largest, improved in the three months through June, and the unit lowered the amount set aside to cover bad credit card and auto loans by $44 million to $506 million, according to the statement. Consumer banking profit overall climbed 4.3%, the bank said, and average deposit balances increased 6% to $545.5 billion.

Despite its credit card growth, Bank of America continues to emphasize responsible lending, Moynihan noted.  "We're not going to open the credit card business in a way that will produce charge-offs later down the road in a way we won't be happy with," he said. "We are driving that growth into the core strong credit quality that we want to have in this company."

The number of mobile banking customers continued to increase as customers shifted away from traditional branches, allowing Consumer Banking to shave 4% from non-interest expenses as it closed some branches and trimmed workers. About 13% of all deposits were handled through mobile devices, compared with 10% a year earlier.

"This business is a good representation of how the company is doing more business while we continue to reduce expenses," Thompson said. "We remain a leader in many aspects of consumer banking, doing business with roughly half of all U.S. households."

Companywide expenses also declined, falling 6% from a year earlier to $13.6 billion, excluding interest and litigation costs. That's the lowest expense base in years, Christopher Mutascio of Keefe, Bruyette & Woods said in a note to clients. Both compensation and non-compensation expenses were better than expected, he said.