(Reuters) - A federal judge refused to dismiss a lawsuit accusing Bank of America Corp (>> Bank of America Corp) of misleading shareholders about its exposure to risky mortgage securities and its dependence on an electronic mortgage registry known as MERS.

U.S. District Judge William Pauley in Manhattan said shareholders led by a Pennsylvania school pension fund may pursue securities fraud claims against the second-largest U.S. bank to recover billions of dollars of alleged losses.

Pauley said the allegations raised a "strong inference" that Bank of America intended to mislead about its reliance on the registry, vulnerability to mortgage buyback claims, internal controls and compliance with accounting and securities rules.

But the judge dismissed a variety of claims against current and former Bank of America executives and directors, including current Chief Executive Brian Moynihan and his predecessor, Kenneth Lewis, and dozens of underwriters.

Bank of America spokesman Lawrence Grayson declined to comment. Mark Rosen, a lawyer for lead plaintiff Pennsylvania Public School Employees' Retirement System, did not immediately respond to a request for comment.

The bank also faces much litigation, including over its purchases of mortgage lender Countrywide Financial Corp in July 2008 and Merrill Lynch & Co six months later.

TARP REPAYMENT

Shareholders alleged they had been misled into buying Bank of America stock in 2009 and 2010, including stock sold to repay $45 billion of federal bailout money from the Troubled Asset Relief Program (TARP).

They claimed Bank of America knew it could not raise enough capital - and escape TARP restrictions on executive pay - had the bank revealed it might have to repurchase billions of dollars of securities backed by risky loans, including from Countrywide.

Shareholders also said the bank knew that recordkeeping in Merscorp Inc's private Mortgage Electronic Registration Systems registry was so poor that it would not be able to legally foreclose on thousands of delinquent mortgages.

Bank of America countered that it had properly disclosed its use of MERS, and that it had no duty to disclose the speculative possibility of large buybacks.

While ruling that the plaintiffs failed to sufficiently establish that Moynihan, Lewis and other executives intended to violate the law, Pauley said they may renew some claims.

MERS

Mortgage loan giants Fannie Mae (>> Federal National Mortgage Association) and Freddie Mac (>> Federal Home Loan Mortgage Corp) and several large banks established MERS in 1995 to circumvent the often costly, cumbersome process of transferring ownership of mortgages and recording changes with county clerks.

Like other major lenders, Bank of America temporarily suspended foreclosures in October 2010 as regulators nationwide began probing "robosigning" and other abuses.

It was one of five big mortgage servicers to join February's roughly $25 billion U.S. settlement over foreclosure abuses. An $8.5 billion settlement of mortgage repurchase claims, meanwhile, is being reviewed in a New York state court.

Moynihan in May said the bank's roughly $3 billion quarterly cost to collect payments on home loans and work with struggling borrowers will not fall significantly until 2013.

Analysts expect the bank on July 18 to post a second-quarter profit of 15 cents per share, according to Thomson Reuters I/B/E/S. It lost 90 cents per share a year earlier, when it set aside reserves for the $8.5 billion settlement.

The case is Pennsylvania Public School Employees' Retirement System et al v. Bank of America Corp et al, U.S. District Court, Southern District of New York, No. 11-00733. (Reporting By Jonathan Stempel in New York; Additional reporting by Rick Rothacker in Charlotte, North Carolina; Editing by Steve Orlofsky)

By Jonathan Stempel