NEW YORK (Reuters) - Technology stocks pushed the S&P 500 and Nasdaq higher on Thursday, driven by Apple shares as the iPhone maker became the first publicly traded U.S. company worth a trillion dollars.

Apple Inc AAPL.O extended its post-earnings rally, gaining 2.9 percent and pushing its market value across the trillion-dollar threshold.

“It’s a good sign for the market and the economy,” said Kim Forrest, senior portfolio manager at Fort Pitt Capital Group in Pittsburgh. “Because even though today we’re talking about the impact of trade or currency war, an issue with China, Apple, who makes most of their products in China, is hitting this.”

The smartphone maker led the S&P technology index .SPLRCT 1.4 percent higher, the biggest percentage gainer among the 11 major sectors of the S&P 500.

Among the other members of the so-called FAANG group of momentum stocks, Facebook Inc FB.O rose 2.7percent, Alphabet Inc GOOGL.O edged up 0.7 percent, Netflix NFLX.O rose 1.8 percent and Amazon.com AMZN.O advanced 2.1 percent.

The tech sector’s gain helped offset escalating trade tensions, as China urged the United States to “calm down” after U.S. Trade Representative Robert Lighthizer said he had been directed to increase previously proposed tariffs on Chinese imports. At a news briefing, China’s foreign ministry spokesman called the United States’ tactics “blackmail.”

“The tariff rhetoric is always important to monitor,” said Bucky Hellwig, senior vice president at BB&T Wealth Management in Birmingham, Alabama. “But more importantly, what’s the effect on the market?”

Traders work on the floor of the New York Stock Exchange shortly after the opening bell in New York, U.S., July 31, 2018. REUTERS/Lucas Jackson

“We get a sell-off on some event, and the market comes right back,” Hellwig added.

Trade-sensitive industrial companies, including Boeing Co BA.N and Caterpillar Inc CAT.N, helped drag the blue-chip Dow slightly lower.

The Dow Jones Industrial Average .DJI fell 7.66 points, or 0.03 percent, to 25,326.16, the S&P 500 .SPX gained 13.86 points, or 0.49 percent, to 2,827.22 and the Nasdaq Composite .IXIC added 95.40 points, or 1.24 percent, to 7,802.69.

Shares of Tesla Inc TSLA.O jumped 16.2 percent after quarterly results convinced investors of future profitability and Chief Executive Elon Musk apologized for his behavior on the previous earnings call.

For the second-quarter reporting season, 79.7 percent of the 380 companies in the S&P 500 that reported so far have beaten consensus estimates, according to Thomson Reuters data.

Chemical producer DowDuPont Inc DWDP.N posted profit that beat consensus estimates for the fourth straight quarter, driven by price increases and strong demand. But its stock fell 2.2 percent after the company warned of rising raw materials costs.

On the deal front, Cisco Systems Inc CSCO.O announced it would buy venture capital-backed cyber security firm Duo Security for $2.35 billion in cash. Cisco stock rose 1.6 percent on the news.

Advancing issues outnumbered declining ones on the NYSE by a 1.41-to-1 ratio; on Nasdaq, a 1.58-to-1 ratio favored advancers.

The S&P 500 posted 14 new 52-week highs and five new lows; the Nasdaq Composite recorded 93 new highs and 100 new lows.

Volume on U.S. exchanges was 6.66 billion shares, compared with the 6.25 billion-share average over the last 20 trading days.