Bank of America on Friday said it has secured a $20 billion government investment to assist in acquiring brokerage Merrill Lynch. The government will also cover a majority of losses linked to Merrill's assets.

The investment gives the U.S. preferred stocks carrying an 8 percent dividend rate, the bank said. The government also agreed to provide protection for the bank against further losses on $118 billion in assets, primarily from the former Merrill Lynch portfolio.

Bank of America said that under the agreement, the bank would cover the first $10 billion in losses while the government would cover 90 percent of any subsequent losses. The bank would pay a premium of 3.4 percent of those assets for this program.

The announcement comes as the bank reported a fourth quarter net loss of $1.79 billion compared with a net income of $268 million a year earlier. The results were driven by escalating credit costs, including additions to reserves and significant writedowns and trading losses in the capital markets businesses, the bank said.

The net loss applicable to common shareholders was $2.39 billion, or $0.48 per diluted share, down from a net income of $0.05 per share, in the same period in 2007.