Expanding rapidly as the nation’s largest home mortgage company, Countrywide Home Loans quietly promised investors who bought its loans that it would repurchase some if homeowners got into financial difficulties.

But now that Countrywide itself is struggling, it may not be able to do so, making it even harder for troubled borrowers to reduce their interest rates or make other changes to their loans to avoid foreclosure.

The possibility that Countrywide may have to buy back mortgages that it sold comes on the heels of its announcement last week that the tightening credit markets had forced it to draw on its $11.5 billion line of credit from a consortium of banks, a move that sent the market plummeting.

But yesterday, Bank of America agreed to invest $2 billion in Countrywide, buying preferred shares that carry an interest rate of 7.25 percent and can be converted into common stock at $18 each.