Stocks rose on Monday, ending a four-day losing streak as data showed the services sector expanded for the first time since August 2008 and optimism about upcoming earnings took hold.

Financial stocks rallied, and were the top positive on the S&P 500 index after Goldman Sachs upgraded the large-cap bank sector. It said share prices for companies in the industry didn't reflect their earnings power.

The Institute for Supply Management's index for the U.S. services sector rose to 50.9 in September, crossing the 50 threshold that indicates expansion and topping expectations. The services sector represents about 80 percent of the U.S. economy.

We are a service economy to a large extent, and finally getting above the 50 level is a pretty positive signal that things are picking up, said Owen Fitzpatrick, head of U.S. Equity Group, Deutsche Bank Private Wealth Management, in New York. We're off to a pretty good start this week with that number.

Third-quarter earnings kick off this week with the release of Alcoa results on Wednesday. Stocks rallied sharply after second-quarter results, with more than 70 percent of companies beating expectations.

The Dow Jones industrial average <.DJI> was up 112.15 points, or 1.18 percent, at 9,599.82. The Standard & Poor's 500 Index <.SPX> was up 14.79 points, or 1.44 percent, at 1,040.00. The Nasdaq Composite Index <.IXIC> was up 21.10 points, or 1.03 percent, at 2,069.21.

The day's gains came after markets posted their second straight week of losses last week, as investors questioned the strength and timing of an economic recovery after weak data on jobs and factory orders.

I think the earnings season will be positive overall, Fitzpatrick said. We'll probably hear things are improving and see some areas of top-line growth occurring.

On the Nasdaq, shares of Brocade Communications Systems Inc surged 17.5 percent to $8.97 after The Wall Street Journal reported that the network equipment maker had put itself up for sale, citing sources familiar with the matter.

Goldman also upgraded Wells Fargo & Co to buy, and its shares rose 7.4 percent to $28.23. The KBW Banks index <.BKX> advanced 3.1 percent while the S&P Financial index <.GSPF> added 3.2 percent.