By Anna Hirtenstein

The Dow Jones Industrial Average rose Tuesday after better-than-expected earnings reports from some of the U.S.'s largest companies.

The blue-chip index gained 320 points, or 1.2%, while the S&P 500 rose 0.6%, and the Nasdaq Composite slipped 0.2%.

Shares of Coca-Cola rose 3.2% after the company reported its second-quarter earnings per share declined 32% but beat expectations. The beverage giant said July was trending better than previous months but it sill couldn't estimate the full-year expectations.

Shares of IBM rose 1.6% after its second-quarter revenue fell less than Wall Street expected, and cloud-computing revenue jumped 30%. Snap, another tech company that investors have favored this year, is scheduled to report earnings after U.S. markets close.

Tech stocks had led the market higher Monday, sending the Nasdaq to a new record. Some analysts said those stocks are likely to remain in focus ahead of their earnings.

"Tech names have outperformed very strongly against the market," said Luc Filip, head of private banking investments at SYZ Private Banking. "We think this will last at least for the next few days until we see the results" for Microsoft and Amazon.com this week, he said.

Lockheed Martin's shares rose 1.7% after the defense giant reported that its quarterly revenue and profit were above expectations and revised its full-year outlook higher.

Overseas, the pan-continental Stoxx Europe 600 rose 0.8% after European Union leaders struck a historic deal overnight on the terms for a EUR1.8 trillion ($2.06 trillion) spending plan. The package will center around the bloc's first-ever issuance of common bonds, and could help deepen the bloc's economic integration.

"It is an important moment in the history of the European Union, given the size of the package and the fact this will be financed by EU bonds," said Sébastien Galy, senior macro strategist at Nordea Asset Management. "Such common liabilities for the European Union are unprecedented in size."

The pact helped boost global energy prices, carrying Brent crude up 3.4%, above $42 a barrel for the first time since early March when prices plunged amid a pricing war between Saudi Arabia and Russia. U.S. oil rose 3.2%.

Chevron and Exxon Mobile both climbed more than 5% to boost the Dow industrials. The energy sector led the S&P 500 higher, with oil-field servicer Halliburton and producers Devon Energy and Diamondback Energy all up more than 5%.

In European equities, Norwegian digital marketplace operator Adevinta surged 25% after it acquired eBay's classified-ads business for $9.2 billion. Schibsted, a media company which owns a stake of Adevinta, rose 16%.

Gold prices continued to climb, reaching their highest level since 2011. It rose 1.1% to $1,837.50 per troy ounce. Investors are buying the metal as a haven asset and to hedge against potential inflation as central banks continue to pump money into the system, according to SYZ's Mr. Filip.

"It's almost a no-brainer, let's buy some gold to hedge when there's many uncertainties still," Mr. Filip said. His company currently holds between 4.5% and 5% of its portfolio in gold.

Silver also continued to climb for the third day, rising 6.1%. The benchmark price is up around 8% so far this week.

In Asia, most major equity benchmarks ended the day with muted gains. Hong Kong's Hang Seng Index was among the biggest gainers after it rallied over 2%. Japan's Nikkei 225 rose 0.7%.

David Benoit contributed to this article.

Write to Anna Hirtenstein at anna.hirtenstein@wsj.com