U.S. stocks rose on Friday following encouraging economic data on consumer sentiment and trade, while the S&P 500's break above key levels pointed to further gains.

After rising above the key technical level around 1,228, the S&P 500 was trading just above 1,235, which represents the two-year intraday high reached earlier in the week.

In the latest signs of improvement in the U.S. economic recovery, data showed consumer sentiment rose more than expected in early December, while import prices in November climbed at their fastest pace in a year. Another positive signal came from the Commerce Department, which said the U.S. trade deficit narrowed much more than expected in October.

A recent string of stronger data and technically bullish signals have suggested to some analysts that the market is likely to rally through the end of the year after some consolidation.

When you violate resistance, there's a tendency for it to really go higher, said Chris Burba, a short-term market technician at Standard & Poor's.

Noting a bullish sign for the S&P 500, he added that surpassing 1,227-1,229 is important ... basically telling you the crowd is willing to buy (stocks) at higher prices. I think the market is in a natural place not only to rise, but for the pace to speed up..

The Dow Jones industrial average <.DJI> gained 18.39 points, or 0.16 percent, to 11,388.45. The Standard & Poor's 500 Index <.SPX> rose 4.23 points, or 0.34 percent, to 1,237.23. The Nasdaq Composite Index <.IXIC> gained 12.29 points, or 0.47 percent, to 2,628.96.

Shares of Netflix Inc jumped after Standard & Poor's said the movie rental company, along with F5 Networks Inc and Newfield Exploration Co, will replace Office Depot Inc , New York Times Co and Eastman Kodak Co in the S&P 500. Netflix shot up 2.2 percent to $195.30.

Earlier in the session, the dollar's strength kept a lid on stocks' gains since stocks and the greenback have moved in opposite directions lately. The U.S. Dollar Index <.DXY>, which measures the dollar's performance against a basket of major trading partners' currencies, was flat at midday at 80.069, after earlier hitting an intraday high at 80.304.

A drop in oil prices weighed on energy shares. U.S. crude oil futures slid 61 cents, or 0.69 percent, to $87.76 a barrel. Shares of Exxon Mobil Corp slipped 0.3 percent to $71.77.

(Reporting by Caroline Valetkevitch; Additional reporting by Leah Schnurr; Editing by Jan Paschal)