Gains were broad, with all but one of the S&P’s 10 primary sector indexes rising for the day. An S&P index of healthcare stocks <.SPXHC> gained 1.2 percent and led the advance, while an index of energy stocks <.SPNY> dragged, slipping 0.5 percent.

Russian President Vladimir Putin said Russia would stand up for itself but not at the cost of confrontation with the outside world, striking a softer tone after tough rhetoric aimed at Ukraine for several months.

The market had been pressured in recent weeks by uncertainty over the conflict.

Earnings season continued to wind down, with 92 percent of S&P 500 companies having reported quarterly earnings by Thursday morning. Of the companies that have reported results so far, 67.7 percent beat analysts' expectations.

Wal-Mart Stores Inc (>> Wal-Mart Stores, Inc.), the nation's largest retailer, reported earnings and revenue that met expectations. But the company cut its forecast for coming quarters. The Dow component's stock rose 0.5 percent to $74.39.

Shares of Cisco Systems Inc (>> Cisco Systems, Inc.), another Dow component, fell 2.6 percent to $24.54. The network equipment maker gave a tepid outlook for its current quarter and announced massive job cuts despite reporting revenue that beat expectations.

The stock market has looked past flaring tensions abroad to rally for an extended period, with the S&P 500 marking more than 1,000 days since its last correction, which Wall Street defines as a drop of 10 percent from the most recent high.

“In October, the Fed is going to get away from money printing, and since we haven’t had a correction in a long time, it could undermine things very quickly once people realize growth isn’t in line with their expectations,” said Jeff Duncan, president of Duncan Financial Management in Sunset Hills, Missouri.

The Dow Jones industrial average <.DJI> rose 61.78 points, or 0.37 percent, to close at 16,713.58. The S&P 500 <.SPX> gained 8.46 points, or 0.43 percent, to finish at 1,955.18. The Nasdaq Composite <.IXIC> added 18.88 points, or 0.43 percent, to end at 4,453.00.

Shares of Boeing Co (>> The Boeing Company) shot up 1.7 percent to $124.11, making it the Dow's second-biggest gainer. The company said demand for its commercial jetliners was very strong and signaled it is getting close to deciding whether to further accelerate output.

The price of Berkshire Hathaway Inc's (>> Berkshire Hathaway Inc.) Class A stock crossed $200,000 for the first time on Thursday in the latest milestone for the company that Warren Buffett built over nearly five decades. Berkshire Hathaway closed at $202,850, up 1.8 percent on the New York Stock Exchange.

After the bell, shares of Nordstrom Inc (>> Nordstrom, Inc.) slid 1.7 percent. The upscale department store chain, known for its selection of fashion labels and customer service, reported second-quarter earnings in line with expectations and a 3 percent increase in same-store sales.

JC Penney Co Inc (>> J C Penney Company Inc) shares initially rose 7 percent to $10.40 in extended-hours trading before falling to unchanged from the NYSE close at $9.74. After the bell, the department store chain reported quarterly sales rose 5 percent while its quarterly loss narrowed to 56 cents per share.

Shares of Monster Beverage Corp (>> Monster Beverage Corp) soared 30 percent to $71.65 in extended-hours trading on news that the energy drink maker entered a long term partnership with Coca-Cola Co (>> The Coca-Cola Company).

During the regular session, Red Robin Gourmet Burgers (>> Red Robin Gourmet Burgers, Inc.) had its worst trading day since November 2006. The burger chain reported quarterly earnings and revenue sharply below expectations, sending its stock tumbling 18.5 percent to $52.63.

About 4.7 billion shares traded on all U.S. platforms, according to BATS exchange data, compared with the five-day average of 5.4 billion.

(Editing by Nick Zieminski and Jan Paschal)

By Akane Otani