By Yifan Wang

Shares of JD.com, one of China's largest online retailers, rose on their trading debut in Hong Kong after the firm raised $3.9 billion via a secondary listing in the city.

Shares opened 5.8% higher from the offering price of 226 Hong Kong dollars (US$29.16), despite broader market weakness Thursday. The benchmark Hang Seng Index fell 1.1% in early trade on concerns over a second wave of coronavirus infections in the U.S.

The stock later narrowed opening gains.

JD plans to use proceeds from the offering to invest in supply-chain technologies in efforts to improve operating efficiency and enhance customer experience.

The deal size could increase to around $4.5 billion if an overallotment option is exercised.

JD's listing comes amid a recent wave of Chinese technology companies seeking secondary listings closer to their home market as U.S.-China tensions spill over into financial-markets issues. The Senate in May passed a bill that could kick Chinese companies off U.S. stock exchanges unless American authorities can inspect their audits.

Mobile-game firm NetEase Inc. raised more than $2.7 billion in its secondary listing in Hong Kong last week, a move that followed e-commerce giant Alibaba Holdings' fundraising of more than $11 billion in November.

Investors have welcomed the offerings, with robust demand buoying the Hong Kong dollar in recent weeks and prompting intervention to curb strengthening of the pegged currency.

JD's Nasdaq-listed shares, up 76% so far this year, have repeatedly reached record highs since the secondary stock sale was announced earlier this month. raising the company's market capitalization to nearly $14 billion.

JD shares in Hong Kong were last up 3.4% at HK$233.60.

Write to Yifan Wang at yifan.wang@wsj.com

Corrections & Amplifications

This story was corrected June 18,2020. The original in the last paragraph included an incorrect figure of nearly $14 billion company's market capitalization.