By Alexandra Scaggs And Saumya Vaishampayan 

U.S. stocks rose on Tuesday, boosted by gains in European equities and as higher oil prices lifted energy shares.

The Dow Jones Industrial Average advanced 169 points, or 1%, to 17532. The S&P 500 gained 12 points, or 0.6%, to 2033, and the Nasdaq Composite Index rose four points, or 0.1%, to 4681.

Shares climbed on the heels of a rally in European stocks, amid hopes of a resolution to the standoff between the new Greek government and its creditors. U.S. investors have been keeping a close eye on Europe in recent months, as they worried about deflation and political tensions. Now, stocks in the region are rallying as concerns about Greece subside and after the European Central Bank announced fresh stimulus. Greek stocks jumped 11%, Germany's DAX 30 gained 0.8% and France's CAC 40 added 1.2%.

U.S. crude-oil futures gained 3.1% to $51.10 a barrel, helping spur on a 2.1% rise in the energy sector of the S&P 500. With that gain, energy shares have erased a 2015 loss of as much as 7.6%. Shares of Exxon Mobil Corp. and Chevron Corp. were among the biggest gainers on the Dow industrials.

Tuesday's advance extended a gain from Monday, when indexes rallied broadly at the end of the session. Traders said the move wasn't driven by any particular piece of news, but by investors who are buying to avoid missing out on gains if stocks continue to rise.

"They don't want to miss the bus," said Jonathan Corpina, senior managing partner at brokerage firm Meridian Equity Partners.

The slide in crude-oil prices since last summer has added to volatility in the stock market, as investors weigh the hit to earnings and capital spending at energy companies against the benefits to consumers. As of Monday, the S&P 500 had made five consecutive swings of more than 1%.

"Volatility is very well entrenched in this market," said Mr. Corpina. "The negative to that is, it shows how uncommitted investors are...the investment horizon has gotten short."

Many investors say that consumer spending could pick up as people save money at the pump. "It takes a while for people to adjust their behavior, " said Colin Cieszynski, chief market strategist at CMC Markets. "That's why you get the lag effect for the benefits" of lower oil prices, he added.

Still, the oil-price dive is weighing down corporate profits. Fourth-quarter earnings of S&P 500 energy companies are expected to shrink 23% from last year, according to FactSet. Broadly, the S&P 500 is expected to grow earnings by 2.3%, the slowest pace since 2012.

"Earnings aren't that great. They've sort of stalled out," said John Manley, chief equity strategist at Wells Fargo Asset Management. Earnings "have been a supporting factor" for stocks, so he expects "more of the same volatility."

Signs of slowing economic growth globally, increased easing efforts in Europe and an eventual interest-rate increase in the U.S. have exaggerated stock-market swings in recent weeks. The CBOE Volatility Index, which measures expectations for swings in the S&P 500, slipped to 18.65, just below its 10-year average of 20 but well above its 2014 average of 14.2.

In economic news, December factory orders fell 3.4%, more than the 2.5% decline forecast. Investors are looking ahead to high-profile data later in the week, including Friday's nonfarm-payrolls report for January.

Staples Inc. and Office Depot Inc. are in advanced talks to combine, The Wall Street Journal reported. Office Depot absorbed rival OfficeMax in 2013. Staples shares jumped 10%, leading the S&P 500 higher. Office Depot shares surged 17%.

Ford Motor Co. and General Motors Co. gained 1.3% and 2.2%, respectively, after global auto makers said their U.S. sales grew in January, which is normally a slower month for the industry.

United Parcel Service Inc. slipped 0.6% after it provided a 2015 earnings forecast that was at the low end of Wall Street's expectations.

BP PLC posted a loss in the fourth quarter, the first of the world's giant oil companies to do so amid the slump in oil prices. Still, BP's underlying earnings, which factor out one-time items, beat analysts' expectations. The company announced an increased dividend. U.S.-listed shares rose 2.5%.

In other markets, gold futures lost 1.3% to $1261.00 an ounce.

Treasury prices fell, pushing the yield on the 10-year note up to 1.748% from 1.669% on Monday.

Write to Alexandra Scaggs at alexandra.scaggs@wsj.com and Saumya Vaishampayan at saumya.vaishampayan@wsj.com

Access Investor Kit for Chevron Corp.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US1667641005

Access Investor Kit for The Dow Chemical Co.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US2605431038

Access Investor Kit for Exxon Mobil Corporation

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US30231G1022

Access Investor Kit for Ford Motor Co.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US3453708600

Access Investor Kit for General Motors Co.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US37045V1008

Access Investor Kit for Office Depot, Inc.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US6762201068

Access Investor Kit for Staples, Inc.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US8550301027

ODP (NASDAQ:ODP)
Historical Stock Chart
From Jun 2024 to Jul 2024 Click Here for more ODP Charts.
ODP (NASDAQ:ODP)
Historical Stock Chart
From Jul 2023 to Jul 2024 Click Here for more ODP Charts.