Apple CEO Tim Cook escorts President Donald Trump as he tours Apple's Mac Pro manufacturing plant with Treasury Secretary Steven Mnuchin looking on in Austin, Texas, November 20, 2019.

In the midst of the holiday shopping season, Apple avoided tariffs on its core products, including the iPhone, after President Donald Trump announced Friday that the U.S. has reached a phase one trade deal agreement with China and tariffs set for Sunday "will not be charged."

Trump tweet.

The 15% duties that had been scheduled to begin Sunday targeted Chinese-made consumer goods, including phones and computers. Apple already pays tariffs on products including the Apple Watch and AirPods, but hasn't raised its prices in the United States.

The deal, which has not been signed, is set to be a major relief for Apple, which has established a massive supply chain based in Asia that was threatened by the Washington-Beijing trade war. Apple produced 218 million iPhones in 2018, nearly all of them assembled in China. Apple declined to comment on the trade deal.

Apple's stock was up nearly 1% Friday and hit a new intraday high.

"While this continues to all be a game of high stakes poker between the U.S. and China, Apple given this tariff deadline was directly in the crossfire given its flagship iPhone manufacturing footprint in China," Wedbush analyst Dan Ives wrote in a note on Thursday. Apple has more to lose than any other company if an agreement couldn't be reached, he added.

China is also a key market for Apple to sell its products. Apple reported $51 billion in revenue in 2018 from "Greater China," which includes Hong Kong and Taiwan. It's Apple's third-biggest region by sales.

In addition to the iPhone, the proposed "List 4B" tariffs would have affected Apple's iPad and MacBook laptops, which are also core products for Apple.

Although the trade deal affects billions of dollars worth of goods, it's a particular victory for Apple CEO Tim Cook, who has personally worked to keep communication open with the Trump administration. Cook's charm offensive culminated last month when he gave Trump a tour of a Mac Pro assembly plant in Texas. That computer is assembled in the United States, and Apple was granted tariff waivers for several of its components.

"To his credit, Tim Cook has managed to maintain a good relationship with the administration, which is a positive," said Thomas Cooke, a professor at Georgetown University's McDonough School of Business.

Trump previously said that Apple's CEO made a "good case" about Apple being affected by the tariffs whereas its primary smartphone competitor would not be because Samsung imports its phones from Korea.

"I thought he made a very compelling argument," Trump told reporters in August. "It's tough for Apple to pay tariffs if it's competing with a very good company that's not."

Follow @CNBCtech on Twitter for the latest tech industry news.