The federal government filed a civil lawsuit against Bank of America Corp., alleging the second-biggest U.S. bank by assets and its Countrywide Financial Corp. unit saddled taxpayers with losses by misrepresenting the quality of home loans they sold to mortgage-finance firms Fannie Mae and Freddie Mac.

The action, filed Wednesday in federal court in Manhattan, seeks at least $1 billion in damages. The filing represents an effort to defray costs tied to the 2008 bailout of Fannie and Freddie and potentially opens a new front...