Richard Drew, AP
People pass a Bank of America brach, in New York, Monday, Jan. 7, 2013. Bank of America will pay $10.3 billion to the government mortgage agency Fannie Mae to settle claims resulting from mortgage-backed investments that soured during the housing crash. (AP Photo/Richard Drew)

NEW YORK — Bank of America is announcing plans to buy back $4 billion in stock after getting conditional approval from the Federal Reserve.

The buyback will be done through June 2016, the bank said Wednesday.

Bank of America's buyback plan comes with conditions, however. In the results from the Fed's annual "stress tests," the Fed said BofA had "deficiencies in its capital planning process" and asked the bank to resubmit its plans by September 30. If BofA's resubmitted plans do not meet the approval of Fed regulators, the central bank could put a stop to BofA's buyback and dividend.

"We are committed to meeting the requirements in the time frame the Fed has established," BofA CEO Brian Moynihan said in a statement.