Bank of America Corp. is acquiring an insurance underwriting and distribution business along with a large mortgage lender.

Bank of America, Charlotte, N.C., today announced that it will be paying stock with a value of about $4 billion for Countrywide Financial Corp., Calabasas, Calif.

As a result of weakness in the mortgage and real estate markets, Countrywide has reported $282 million in net losses for the first three quarters of 2007 on $4.9 billion in revenue, down from $2.1 billion in net income on $8.7 billion in revenue for the comparable period in 2006.

But Bank of America says it will be getting an organization that still managed to originate $408 billion in mortgage loans in 2007 in spite of the turmoil.

The deal has been approved by the boards of Bank of America and Countrywide, and it now is subject to approval by regulators and by Countrywide shareholders.

Countrywide has an insurance segment that sells insurance and reinsurance.

Countrywide’s Balboa Life and Casualty Group, the retail insurance unit, sells term life, credit life and credit disability insurance as well as voluntary homeowners and automobile insurance and lender-placed property and automobile insurance.

Balboa Life also has a commercial insurance unit that sells employee benefits products along with property-casualty insurance to home builders, mortgage broker, bankers, real estate brokers and commercial property owners, the company says.

Another unit in the Countrywide insurance segment, Balboa Reinsurance Company, sells mortgage reinsurance.

The insurance operations at Countrywide generated $1.1 billion in net premiums during the first three quarters of 2007, up from $865 million in net premiums during the comparable period in 2006, according to the financial statement Countrywide filed with the U.S. Securities and Exchange Commission for the third quarter of 2006.

The insurance segment is reporting $429 million in pretax earnings for the first three quarters of 2007 on $1.2 billion in revenue, up from $245 million in pretax earnings on $942 million in revenue for the comparable period in 2006.

Balboa Life reported $89 million in pretax earnings for the third quarter of 2007 on $316 million in net insurance premiums earned, up from $43 million in pretax earnings on $244 million in net insurance premiums earned for the third quarter of 2006.

The national and New York life insurance companies generated about $5.4 million in net income in 2006 on $21 million in net premiums written, according to statutory statement data provided by Highline Data L.L.C., a sister company of The National Underwriter, the company that publishes the NU Online News Service.

Insurance commissions paid fell to $46 million for the third quarter of 2007, from $51 million for the third quarter of 2006.

The Countrywide insurance segment employed about 2,280 people during the third quarter.