The Bank of America cost-cutting machine hummed along for another quarter.

The second-biggest U.S. lender said that second-quarter profit surged 33 percent to $6.8 billion, exceeding the $5.92 billion estimate of analysts surveyed by FactSet. Executives said it was the 14th straight quarter the company posted positive operating leverage, or increased profit by turning levers including costs. The company's shares rose more than 4 percent at 2:30 p.m. New York trading.

The Charlotte, North Carolina-based bank said it managed to boost revenue while cutting expenses more than analysts had expected. The lender trimmed costs by 5 percent to $13.3 billion, beating the $13.5 billion forecast of analysts surveyed by Thomson Reuters. Meanwhile, revenue rose 3 percent to $22.6 billion, compared with the $22.3 billion estimate, excluding a year ago-gain tied to a business sale. The company's earnings per share surged 43 percent to 63 cents per share, crushing the 57 cent per share estimate.

Still, of all the figures on the bank's income statement for the quarter, the most stark change was a 43 percent drop in the bank's income taxes to $1.7 billion from $3 billion. That looked to be the single biggest factor in the bank's profit increase in the quarter. The Trump administration's tax cut, which took effect this year, also allowed the company to announce a new $500 million technology investment, Bank of America said.

Chief Executive Officer Brian Moynihan has cleaned up much of the mess he inherited when a predecessor purchased subprime lender Countrywide Financial a decade ago. He has since focused on methodically reducing costs while looking for modest profit opportunities, often repeating his mantra of “responsible growth.” The company benefited from a U.S. economy in growth mode, lower taxes after the administration's overhaul, higher interest rates and an environment in which consumers are still repaying loans.

Bank of America set aside $800 million for credit losses in the quarter, less than the $973.5 million expected by analysts. Nonperforming loans fell half a billion dollars from the first quarter of 2018 on improvements in consumer and commercial debt. While the bank grew loans and leases to $935.8 billion, that was below the $942 billion estimate.

"Responsible growth continued to deliver as a driver for every area of the company," Moynihan said in a statement. "We grew consumer and commercial loans; we grew deposits; we grew assets within our Merrill Edge business; we generated more net new households in Merrill Lynch; and we supported more institutional client activity."

Still, the company’s shares have trailed other banks and the broader stock indexes this year, declining 3.3 percent before Monday.

Bank of America CEO Brian Moynihan will appear on CNBC's "Mad Money" at 6 p.m. ET on Monday.