Workers walk past the offices of Merrill Lynch in London January 16, 2009. REUTERS/Toby Melville

(Reuters) - Bank of America Corp BAC.N and Merrill Lynch agreed on a plan to pay up to $5.8 billion in bonuses to employees of the combined firm as BofA moved to take over the ailing investment bank, the Wall Street Journal said.

As the U.S. government prepares to unveil what could be a nearly $1 trillion economic stimulus package using taxpayers’ money, speculation has swirled over what Bank of America knew about $4 billion in bonuses paid to Merrill Lynch employees before the takeover formally closed.

New York Attorney General Andrew Cuomo is reportedly looking into whether federal bailout loans to BofA were used appropriately, and if shareholders of both companies were given all the necessary information about Merrill’s finances.

There have been rumblings BofA did not know Merrill had decided to pay bonuses in December, instead of in January, but some Merrill employees received part of their compensation in BofA stock on January 2, the Journal said, citing a private bonus agreement it said was struck when BofA agreed to buy Merrill last September.

The bonus agreement shows the two sides had agreed that the discretionary bonus pool at the combined company should not exceed $5.8 billion, and that 60 percent of it should be awarded in cash and 40 percent either in equity or long-term cash awards, the newspaper said.

The move to pay the bonuses in December fueled suspicion among some BofA staffers, who saw their bonuses drop much more sharply than many Merrill employees did even though BofA had bought the company, the paper said.

In a recent email to some top Merrill managers, former Merrill CEO John Thain said BofA knew about every aspect of the December payouts, the Journal said. Thain was ousted from Bank of America on January 22 after the bank discovered surprise losses at the brokerage, three weeks after the $19.4 billion merger closed.

A BofA spokesman has said Merrill’s compensation committee made the decision on the amount and timing of year-end compensation at Merrill, adding that BofA had no legal right to challenge it, the Journal said.

BofA could not be reached by Reuters to comment on the newspaper report.