Xiaomi's second day of life as a public company is going a lot better than its first.

Shares in the Chinese smartphone maker closed 13% higher in Hong Kong on Tuesday, after gaining as much as 15% earlier in the day. The gain followed Xiaomi's weak debut Monday when its shares lost as much as 5.9% before ending the day down about 1%.

The company went public in Hong Kong after raising $4.7 billion in the world's biggest tech IPO since Alibaba's (BABA) huge New York listing in 2014.

Tuesday's rally took Xiaomi's shares comfortably above their issue price of 17 Hong Kong dollars ($2.17).

Related: Xiaomi shares fall in Hong Kong debut

The main reason for the rebound was the announcement that Xiaomi will soon be included in the Hang Seng Composite Index, according to Dickie Wong, head of research at Hong Kong-based broker Kingston Securities.

Xiaomi's inclusion in the index, which will happen later this month, means its shares should become available to mainland Chinese investors through the Hong Kong stock exchange's links with markets in Shanghai and Shenzhen, Wong said.

Traders are betting on enthusiasm from mainland investors to buy Xiaomi shares, he added. The smartphone maker had previously sought to list its shares in mainland China at the same time as in Hong Kong, but later postponed the move indefinitely.

The company's IPO ended up far smaller than the roughly $10 billion it was reportedly targeting earlier this year. And the shares were priced at the bottom of the range the company announced last month.

Xiaomi CEO Lei Jun on Monday had highlighted the recent market turmoil fueled by the escalating trade clash between the United States and China, describing the conditions surrounding the IPO as "far from ideal."

Related: Meet Xiaomi's billionaire executives

Some analysts also expressed doubts about Xiaomi's potential to increase profit margins in the future, given that much of its smartphone sales are at the lower end of the the market.

The company sought to pitch itself to investors as an internet services business rather than a hardware maker. But it struggled to persuade investors to pay a big premium for that.

Xiaomi's main business is phones, but it also sells a range of other internet-connected devices, including laptops and even smart rice cookers. Most of its sales are in China, but it's growing aggressively in other countries such as India.

Analysts at investment bank Macquarie said in a research note dated Monday that they are bullish on Xiaomi's prospects, arguing the company's smartphones are innovative, quick to reach the market and competitively priced.

They expect its business model of making money through additional services on its devices -- such as online gaming and other apps -- to drive strong profit growth. Macquarie estimates Xiaomi shares could eventually be worth as much as 30 Hong Kong dollars ($3.82) each.