Charles Schwab Corp , the largest U.S. discount brokerage, posted higher-than-forecast earnings as rising stock markets fueled increased trading and fees from clients, sending the stock up more than 2 percent.

Profit and revenue both came in above analysts' estimates, driving the stock up 2.1 percent to $18.60 in early trade on the New York Stock Exchange.

Net income for the three months ended March 31 was $243 million, or 20 cents per share, compared with $6 million, or nil per share, in the year-earlier quarter, when a legal settlement nearly wiped out earnings.

Revenue at San Francisco-based Schwab rose to $1.21 billion from $978 million, helped by higher stock markets that generated more trading and fees on invested assets. The Standard & Poor's 500 index rose 4.2 percent in the first quarter.

Analysts, on average, forecast earnings of $225.8 million, or 19 cents per share, on revenue of $1.18 billion, according to Thomson Reuters I/B/E/S.

Rising stock markets have attracted more retail customers to Schwab and led to greater inflows into Schwab mutual funds. But competition from online brokers TD Ameritrade Holding Corp , E*trade Financial Corp and independent broker-dealers has led Schwab to lower prices for trades, hampering revenue growth.

We've definitely seen improvement in investor sentiment over the last several months, Chief Financial Officer Joe Martinetto said in an interview after the quarterly report was released on Friday. He said the results showed the strength of Schwab's business model, in which relatively stable costs allow for rapid earnings growth when revenue rises.

Shares of Schwab, which is highly sensitive to interest rate movements, have gained 4.1 percent this year before Friday's results, partly on expectations that rising interest rates would widen net interest margins and restore fees waived on low-yielding money market funds.

First-quarter revenue rose even though the company waived $112 million in money market mutual fund fees, which have been yielding less than the fees charged on them.

Chairman Charles Schwab said in a statement that clients had reduced their cash holdings at Schwab to levels not seen since before the financial crisis of 2008 and are investing more money in stocks.

At the same time, investors are faced with navigating ongoing challenges - including geopolitical turmoil, vacillating energy prices and the aftermath of major natural disasters, he added.

The company said it had net new assets of $23 billion, and total invested assets reached a record $1.65 trillion at the end of March, up 10 percent from a year ago.

All three major components of revenue rose. Asset management and administration fees charged on client funds rose 20 percent to $502 million, while net interest revenue was up 28 percent at $436 million. Trading revenue gained 15 percent to $241 million.

(Reporting by Philipp Gollner, editing by Gerald E. McCormick, Dave Zimmerman)