Apple Inc. avoided 15% tariffs on its most important products, the iPhone, iPad and MacBooks, after US President Donald Trump signed off on a trade deal with China.

The new import duties were due to kick in Dec. 15 and could have added about $150 to the price of iPhones during the crucial holiday shopping season, according to Wedbush Securities analyst Dan Ives.

“Trump delivered an early Christmas present to Apple,” Ives wrote in a note to investors following news of the trade deal. “If this tariff went through it would have been a major gut punch for semi players/Apple and could have thrown a major wrench into the supply chain and demand for the holiday season.”

A child tries an Apple iPhone 11 Pro Max smartphone (left) at an Apple store during a product launch event in Hong Kong on September 20, 2019. (Picture: Kyle Lam/Bloomberg)

Holding product prices steady while swallowing additional tariffs would have cut Apple earnings per share by about 4% next year. If the company reacted by raising iPhone prices, demand would shrink 6% to 8% in 2020, Ives estimated.

Apple already is paying duties on the Apple Watch, AirPods headphones, iMac desktop computer and HomePod speaker. Some of those levies may be rolled back. The deal presented to Trump on Thursday included a promise by the Chinese to buy more US agricultural goods. Officials also discussed possible reductions of existing duties on Chinese products, according to people familiar with the matter.

Although the Dec. 15 tariffs were averted, the broader trade war has exposed a weakness at the heart of Apple’s business. The world’s largest technology company relies on suppliers and manufacturing partners that are mostly based in China. Apple can’t quickly move production to other countries, so it has counted on a furious White House lobbying campaign this year, led by Chief Executive Officer Tim Cook, to protect its key products from tariffs.

Cook met frequently with Trump this year, and even took criticism for standing beside the president as he blasted the media and House speaker Nancy Pelosi at a Mac Pro assembly facility in Texas last month.

Trump said at that event that it isn’t fair for Apple to be taxed on iPhones built in China given that South Korean rival Samsung Electronics Co. wouldn’t have to pay the duties.

“Cook has become so crucial in these ongoing China negotiations,“ Ives wrote on Thursday. Apple “more than any company out there has the most to lose if this tariff war does not see a truce going forward.”