Hong Kong (CNN Business) Samsung is warning investors that its second quarter profit likely plunged 56%, as the company continued to struggle with sluggish demand for memory chips and smartphones.

The South Korean tech giant said Friday that it expects to make an operating profit of 6.6 trillion Korean won ($5.6 billion) for the quarter ended June, down from about 14.9 trillion Korean won ($12.7 billion) for the same period a year ago.

The earnings forecast was better than analysts' downbeat expectations, thanks to whatcalled a "one-time gain related to the display business." The company supplies display screens to other smartphone makers like

Samsung's profits have taken a beating over the past year, largely because of a slump in its memorychip business. The company's operating profit last quarter fell to its lowest level since late 2016, when it was dealing with the fallout from its Galaxy Note 7 smartphones exploding and catching fire.

A supply surplus and slowing demand for memory chips have created a "tough" environment for Samsung, Rick Seo, an analyst with HSBC, wrote in a recent note to investors.

Weak sales of Samsung's latest flagship phone didn't help. Analysts at brokerage firm Daiwa Capital Markets said in a note that sluggish sales of the company's Galaxy S10 will lead to lower smartphone revenue for the quarter.

Samsung is the world's biggest seller of smartphones. It also has a huge business making key components for rival device manufacturers and is ramping up its 5G network equipment business

That makes the company a potential winner and loser from the current troubles facing Huawei, the world's largest telecommunications equipment maker and No. 2 smartphone seller.

Washington added Huawei to a trade blacklist in May, barring US companies from selling vital tech and components to the Chinese tech giant. In the month immediately following the restriction, Huawei said it saw a 40% drop in overseas sales of its smartphone business.

President Donald Trump changed course and eased restrictions on the Chinese company last week, but it still remains unclear what products American firms can supply to Huawei.

SK Kim, an analyst with brokerage firm Daiwa Capital Markets, said Huawei likely helped memory chip sales in the second quarter as the company was stockpiling supplies. But the US restrictions on Huawei will have "a negative impact" on demand in the coming months, he said.

That would put even more pressure on chipmakers like Samsung to drop prices.

On the upside, Kim said Samsung's smartphone shipments are already seeing "positive impact from the US sanctions on Huawei" and he expects the company's smartphone and network equipment businesses will further benefit from Huawei's woes in the second half of this year.

Samsung is expected to report full earnings at the end of the month.