Apple's no longer the top smartphone maker in China

After dipping for two quarters, Xiaomi reclaimed its spot as the top smartphone maker in China during the second quarter, beating Apple and Huawei, an analyst firm said Monday.

Based in Beijing, China, Xiaomi grabbed 15.9 percent of the country's mobile market share, according to research firm Canalys' estimates.

Xiaomi can bask in the glow of victory for now, but it's under immense pressure to maintain its top position in the quarters to come, Jingwen Wang, analyst at Canalys, said in a note Monday.

Xiaomi Mi 4i smartphones are displayed on a screen during a news conference in Hong Kong, May 5, 2015.
Lam Yik Fei | Bloomberg | Getty Images

Huawei was a close second with a 15.7 percent market share. That represents an increase of about 48 percent sequentially, making it the fastest-growing mobile vendor in China's top 10, Canalys said.

Apple, which held the top spot in the previous quarter, fell to third place, followed by Samsung.

Read More Apple stock can move up on earnings: Analyst

"Apple and Samsung have both increased their sales activities in the China market, expanding rapidly in channel coverage through flagship stores and small to medium-size phone retailers, respectively," Wang said.

A separate report released Friday by Counterpoint ranked Xiaomi in first place, with a 15.8 percent market share, followed by Huawei at 15.4 percent and Apple at 12.2 percent.

China's overall mobile market declined 2 percent from a year ago and 4 percent sequentially, dragged by a muted economic environment, smartphone market saturation and a lack of product related catalysts, according to Counterpoint's analysis.

Read More Xiaomi's Barra pours cold water on IPO speculation

Counterpoint said Xiaomi's China business benefited from clearing out older inventory left in the market and refreshing its portfolio with newer LTE models.

Xiaomi, which released its 5.7-inch Mi Note late last month, recently partnered with Uber in a deal that will allow users to order the Chinese company's new device through the taxi-hailing app.

Xiaomi and Uber are the world's two highest-valued private tech companies, worth $46 billion and $51 billion respectively. Xiaomi is one of the world's largest smartphone makers, and much of its success has been built on the way it has marketed its devices online and sold through online channels.

The company was rumored to be exploring an initial public offering, but Hugo Barra, vice president of Xiaomi's global operations, told CNBC last week there are no IPO plans for the "foreseeable future."

Apple, Xiaomi Samsung and Huawei did not respond to CNBC's requests for comment.

—CNBC's Arjun Kharpal contributed to this report.