Countrywide Financial Corp. (CFC), the largest U.S. mortgage lender, will acquire almost all the assets of home builder KB Home's (KBH) mortgage business, the companies said on Thursday.

The companies also said they have formed a 50-50 joint venture that will make residential loans to KB Home customers. Terms of the agreement were not disclosed.

KB Home customers will have access to Countrywide's mortgage products and Countrywide will have day-to-day oversight of the venture, the companies said.

The KB Home unit, KB Home Mortgage Co. (search) , is a very small part of the company's business, totaling less than 1 percent of the most recent quarter's $3.77 billion in revenue.

"Countrywide is uniquely capable of serving KB Home's large and growing customer base," KB Home Chairman and Chief Executive Bruce Karatz said in a statement.

"Home building and financing have evolved into substantially larger and more sophisticated businesses," he added. "We believe the transition to working directly with an established lending leader makes sense."