Charles Schwab Corp agreed to pay $200 million to settle a federal class-action lawsuit targeting its money-losing YieldPlus mutual fund, erasing nearly all of its first quarter profit.

Shares of the big brokerage were up 1.1 percent after it announced on Tuesday the preliminary settlement, which could spare it a lengthy legal battle and a potentially more costly outcome.

Schwab in 2008 became the target of litigation and regulatory probes focused on its YieldPlus Fund, a short-duration bond fund that plunged in value following the 2007 credit crisis.

A judge last month said it violated U.S. law in failing to get shareholder approval before putting half the fund's assets into uninsured mortgage-backed securities.

The removal of this overhang is clearly a nice positive for the stock, as the settlement is meaningfully smaller than the worst case scenario and it eliminates the risk of further management distraction, Collins Stewart analyst William Tanona wrote in a note to clients.

The settlement forces the brokerage and asset manager to restate first-quarter results that were announced last Thursday. Schwab said it increased its contingency reserve by $172 million pretax, reducing first quarter profit by about $105 million, or 9 cents a share.

That nearly wipes out the $119 million of reported profit, or 10 cents a share. San Francisco-based Schwab previously had set just $11 million aside for potential liability after a summary judgment ruling of liability was issued March 30 with respect to a California state lawsuit.

Schwab did not admit wrongdoing.

Related regulatory probes, including a U.S. Securities and Exchange Commission threat to sue over the fund, and a California lawsuit remain ongoing.

The settlement is preliminary and subject to a definitive agreement as well as court approval. We will move as quickly as we can on getting the approval, said Schwab spokesman Greg Gable.

YieldPlus investors had sought to recover $970 million in damages resulting from the fund's exposure to the collapsing housing and credit markets. Last week, Schwab for the first time said it could be on the hook for as much as $890 million in litigation.

We had expected the company to settle ahead of the May 10 trial date and the total fine ... is smaller than what many had feared, wrote UBS analyst Alex Kramm.

Schwab, which runs a big online brokerage unit and offers investment advice, called the settlement the most effective way for us to move forward.

The company said it will continue to evaluate the size of its contingency reserve pending the final resolution of the class-action suit, and warned its total liability related to YieldPlus could be still higher.

Schwab says it cannot estimate its liability related to regulatory probes, and so has not established a reserve.

Shares of Schwab were up 21 cents, or 1.1 percent, to $19.27 in afternoon trading on the New York Stock Exchange.

(Reporting by Joseph A. Giannone; Editing by Gerald E. McCormick and Tim Dobbyn)