NEW YORK (AP) -- Bank of America earned $6.2 billion in the third quarter on accounting gains and the sale of a stake in a Chinese bank, which offset lower revenue and income in its credit card, real estate and investment banking businesses.Bank of America is also no longer the largest bank in the nation by assets, which fell to $2.21 trillion in the quarter. The Charlotte, N.C. bank ceded the bragging rights to rival JPMorgan Chase & Co. which reported total assets of $2.28 trillion.The slimming down reflects Bank of America's strategy of cutting costs and selling off businesses that don't fit into its simpler banking model. CEO Brian Moynihan said in a conference call with analysts Tuesday he had begun the process of a "strategic transformation of the company."Bank of America earned 56 cents per share, following a loss of $7.3 billion, or 77 cents a share in the same quarter last year. Analysts surveyed by FactSet forecast the bank would earn 28 cents per share.Bank of America Corp.'s stock rose 3 percent to $6.21 at 10 a.m. Tuesday.The income included accounting gains of $4.5 billion and $1.7 billion, both related to drops in the value of its debt. When the price of the bank's debt falls, the bank could theoretically buy it back at a lower cost. Accounting rules require that an income gain be recorded when that happens.Bank of America gained $3.6 billion from selling its stake in China Construction Bank and recorded a loss in its private equity business of $2.2 billion as the value of its investments fell.The sale of its stake in the Chinese bank was part of the bank's effort to focus the company and shed non-core businesses. During the quarter Moynihan realigned the business and reshuffled top management. He got rid of two of the bank's top executives -- head of wealth management Sallie Krawcheck and head of consumer banking Joe Price. Moynihan replaced them with two chief operating officers -- David Darnell to head all consumer businesses and Tom Montag to oversee all commercial relationships.During the quarter, the bank also announced 30,000 job cuts in the quarter as part of an initiative to reduce expenses. Its goal is to reduce expenses by $5 billion a year in the next three years.The third quarter results were hurt by declines in investment banking and trading from its Merrill Lynch division, which has been an income generator in previous quarters. Turbulent financial markets in the third quarter, brought on by the debt crisis in Europe and a downgrade of the U.S. government's credit rating, kept many investors away and led companies to put off stock and bond offerings.Bank of America's investment banking and trading business reported a net loss of $302 million, compared to net income of $1.5 billion in the year-ago quarter. Revenue declined 26 percent to $5.2 billion. Fixed income, currency and commodity sales fell by $3.2 billion, while equity trading declined by $201 million. Investment banking fees fell 21 percent to $1.1 billion.Bank of America's results are considered a proxy for the health of the U.S. consumer because the bank serves about half of all American households. The consumer business results showed that Americans were still holding back spending and demand for loans was low.The bank's consumer real estate business reported a loss of $1.1 billion, while revenue declined 22 percent to $2.8 billion. The bank said it wrote fewer real estate loans due to lower demand.One of the largest credit card issuers, Bank of America's revenue from the division dropped 16 percent to $4.5 billion. Customers used less credit than last year, leading to lower income for the bank.The bank set aside less money for losses as more Americans got their financial houses in order and paid their bills on time. Bank of America's provision for losses from credit cards decreased $2 billion from a year ago to $1 billion.