While Xiaomi has enjoyed a tremendous past few quarters in terms of smartphone shipments and global market relevance, actually making money has proven rather difficult for fairly obvious reasons.

The company continues to rely heavily on sales of low-margin mobile devices, despite constantly looking to diversify its business portfolio and boost revenues derived from software and various so-called internet services.

But somehow, after an initial public offering valuing the tech giant at $54 billion last month, Xiaomi managed to generate a healthy Q2 net profit of 14.63 billion yuan, equating to around $2 billion.

That’s obviously not as impressive as Samsung or Apple’s latest quarterly gains, but it sure beats Xiaomi’s 11.9 billion and 7 billion yuan losses during Q2 2017 and Q1 2018. The company’s overall revenue scores for the April - June 2018 timeframe also substantially exceeded analyst expectations, reaching a whopping 45.23 billion yuan, or $6.6 billion.

Global smartphone shipments totaled 32 million units, yielding a record quarterly revenue of 30.5 billion yuan, which represents a staggering 58.7 percent increase from sales posted a year ago. Unfortunately, that also means no less than 67 percent of Xiaomi’s earnings came from smartphones, a business viewed by many financial specialists as too volatile, competitive, and overcrowded to drive long-term growth.

Still, a profit is a profit, and even though Xiaomi remains committed to an unusual strategy limiting margins at 5 percent for all hardware sales, the brand’s increasing strength in the high-end smartphone arena has to put a smile on the faces of investors around the world.