New York (CNN Business) At one time, the staggering success of the iPhone helped catapult Apple to become the world's most valuable company. Now, its lackluster smartphone sales are dragging down Apple's business.

Apple AAPL said Tuesday that its revenue for the first three months of 2019 declined 5% from the year prior to $58 billion as it grappled with sluggish smartphone demand. iPhone sales for the period fell 17% from the year prior.

For years, Apple's iPhone business appeared to defy gravity as the company managed to sell more devices and gradually charge more for them. But that narrative was shattered at the beginning of this year when the company warned investors that iPhone sales had taken a hit from a slowdown in China amid an ongoing trade war.

However, on a conference call with analysts after the earnings report Tuesday, CEO Tim Cook signaled that the worst may be over for the iPhone as Apple sees signs of improvement in China. In particular he cited "improved trade dialogue" between China and the United States and "very positive customer response to the pricing actions we've taken in that market."

Apple has faced stiff competition in China from competitors like Huawei and Xiaomi, which offer cheaper smartphones at a time when Apple is embracing phones with four-figure price tags. Apple recently reduced the price of some of its products, including the iPhone XS and XR, by nearly 6% in some instances.

Read More