Lenovo isn’t having a good week. After it recently issued a warning over fingerprint management flaws in some of its devices, the second-largest PC manufacturer in the world has posted an unexpected third-quarter loss caused by a $400 million tax reform charge.

Even though the Chinese tech giant generated almost $13 billion in quarterly revenue, its highest in three years, and reported a total operating income of $204 million, a "one-off non-cash tax charge of $400 million" ate into its profits, leaving the company with a net loss of $289 million.

Lenovo said in a statement that the tax hit “follows the re-measurement of US deferred tax assets after the recently enacted US tax reform legislation." But it's not all bad news: "In view of this, the company believes that the lower tax rate can benefit the US operations over time."

While Lenovo’s data center and PC/smart devices groups continued to grow in the third quarter, with the former business recording its highest revenue in two years, the company is still struggling when it comes to smartphones. As Lenovo contends with higher component prices and rival handsets makers, sales for the division fell 5 percent during this quarter and it had a pre-tax loss of $92 million, though this is down from the $112 million loss it previously recorded.

“We will further improve the profitability [of the mobile business], but probably breakeven will not happen in the next quarter,” Chairman and CEO Yang Yuanqing told Reuters.

Lenovo’s PC group fared a lot better. Revenue rose 9 percent YoY to $9.3 billion, while pre-tax profits reached $416 million. But it was the data center group that generated most revenue: $1.2 billion. It still came in at a loss, but this was reduced from $94 million in Q3 2016 to $56 million. Yang said the group was “well on track to deliver a turning around.”