Xiaomi Corp reported a 3.1% rise in second-quarter revenue on Wednesday, even as overall smartphone sales fell as overseas markets struggled with the pandemic.

Sales in the quarter ending June 30 rose to 53.54 billion yuan ($7.77 billion) from 51.95 billion yuan in the same period the prior year, beating analysts' expectations of 51.41 billion yuan.

Revenue from the company's smartphones business, which accounts for nearly two-thirds of its revenue, fell 1.2% to 31.6 billion yuan. Xiaomi sold 28.3 million handsets in the quarter, down from 32.1 million units a year earlier.