ON its way to becoming the nation’s largest mortgage lender, the Countrywide Financial Corporation encouraged its sales force to court customers over the telephone with a seductive pitch that seldom varied. “I want to be sure you are getting the best loan possible,” the sales representatives would say.

But providing “the best loan possible” to customers wasn’t always the bank’s main goal, say some former employees. Instead, potential borrowers were often led to high-cost and sometimes unfavorable loans that resulted in richer commissions for Countrywide’s smooth-talking sales force, outsize fees to company affiliates providing services on the loans, and a roaring stock price that made Countrywide executives among the highest paid in America.

Countrywide’s entire operation, from its computer system to its incentive pay structure and financing arrangements, is intended to wring maximum profits out of the mortgage lending boom no matter what it costs borrowers, according to interviews with former employees and brokers who worked in different units of the company and internal documents they provided. One document, for instance, shows that until last September the computer system in the company’s subprime unit excluded borrowers’ cash reserves, which had the effect of steering them away from lower-cost loans to those that were more expensive to homeowners and more profitable to Countrywide.

Now, with the entire mortgage business on tenterhooks and industry practices under scrutiny by securities regulators and banking industry overseers, Countrywide’s money machine is sputtering. So far this year, fearful investors have cut its stock in half. About two weeks ago, the company was forced to draw down its entire $11.5 billion credit line from a consortium of banks because it could no longer sell or borrow against home loans it has made. And last week, Bank of America invested $2 billion for a 16 percent stake in Countrywide, a move that came amid speculation that Countrywide’s survival was in question and that it had become a takeover target — notions that Countrywide publicly disputed.