US President Trump and Apple CEO Cook announce Apple’s $154 billion investment in US manufacturing (Reuters: Jonathan Ernst)

US stocks ended higher on Wednesday, led by a more than 1% gain in the Nasdaq, as Apple shares climbed after the announcement of a domestic manufacturing pledge, and as some companies delivered upbeat earnings reports.

Shares of Apple jumped 5.1% and provided the biggest boost to all three of the major indexes after company announced a $154-billion domestic manufacturing pledge.

It comes as President Trump pursues an aggressive tariff and trade agenda aimed at moving some manufacturing back into the United States.

Apple said in February it would spend $769 billion in US investments in the next four years that will include a giant factory in Texas for artificial intelligence servers while adding about 20,000 research and development jobs across the country.

Trump’s tariffs cost Apple $1.2 billion in the June quarter and spurred some customers to buy iPhones in late spring this year.

Apple has been shifting production of products bound for the US, sourcing iPhones from India and other products such as Macs and Apple Watches from Vietnam.

In addition, shares of McDonald’s rose 3% after the fast-food restaurant’s affordable menu drove global sales past expectations, while Arista Networks shares jumped 17.5% after the cloud networking company projected current-quarter revenue above estimates.

“Earnings continue to come in better than expected,” said Sam Stovall, chief investment strategist at CFRA Research.

He said while there is uncertainty surrounding tariffs, investors appear to be upbeat about the near term.

Results are now in from about 400 of the S&P 500 companies for the second-quarter earnings season.

About 80% of reports are beating analyst earnings expectations – above the 76% average of the last four quarters – and earnings growth for the quarter is estimated at 12.1%, up from 5.8% at the start of July, according to LSEG data.

with Reuters