Bank of America Corp. imposed a nationwide moratorium on foreclosures and the sale of foreclosed homes after it came under intense pressure from a government-run housing-finance giant worried about documentation problems, people familiar with the situation said.

The bank called the halt as concern mounted from legislators and state prosecutors about procedures used by lenders to foreclose on homes. Many banks use so-called robo signers, employees who sign hundreds of documents a day, without carefully reviewing their contents,...