Chinese e-commerce giant JD.com soared nearly six percent on its Hong Kong debut Thursday, after raising almost $4 billion in an initial public offering that was the world's second-biggest this year.

The new debut comes as Chinese companies -- especially those in tech -- eschew Wall Street because of rising tensions between Washington and Beijing.

It is also a shot in the arm for Hong Kong as fears mount over the potential fallout of Beijing's plan to impose a new national security law on the city banning subversion and foreign interference.

JD, which listed on the Nasdaq in New York in 2014, opened at HK$239 in early morning trading in Hong Kong, compared with its listing price of HK$226. It ended the day at HK$234.00.

It's been a frenetic few weeks for Hong Kong's exchange.

JD.com founder, chairman and CEO Richard Qiangdong Liu
JD.com founder, chairman and CEO Richard Qiangdong Liu GETTY IMAGES NORTH AMERICA / Andrew Burton

Earlier this month fellow Chinese tech giant NetEase raised $2.7 billion in its IPO and also saw a similar six-percent gain on its first day of trading.

Chinese companies are increasingly looking to raise capital closer to home given the soaring trade and diplomatic tensions between the US and China.

Overseas investors are also paying closer attention to the transparency and health of Chinese companies after the once-booming and US-listed coffee chain Luckin Coffee Inc crashed following an accounting scandal.

"We have come to Hong Kong not just because we want to share our promise and development with more clients... but because we have absolute confidence in China and the future of China's economy," JD's Retail Chief Executive Officer Xu Lei said at the opening ceremony.

"If JD wants to become a truly global business, it needs more international capital and not restrict itself to a single country or region," he added.

JD.com is China's second largest ecommerce platform
JD.com is China's second largest ecommerce platform AFP / WANG Zhao

The JD.com IPO is the second-largest globally this year after Beijing-Shanghai High Speed Railway raised $4.3 billion in January, according to Bloomberg News.

The dual listing will help the company better compete with e-commerce rivals including Amazon and Chinese titan Alibaba, which raised a whopping $12.9 billion in a secondary Hong Kong IPO last year.

Alibaba and JD dominate China's online shopping industry. Both companies have launched a major sales drive this month in the first major test of Chinese consumer spending since the coronavirus burst out of central China.

The annual "6.18" which runs for two weeks in June and ends Thursday is the second biggest discount period for Chinese retailers after November's "Singles Day". Both are similar to "Black Friday" in the US.

JD said it had racked up a record $32 billion in sales over the period, suggesting China's emerging consumer spending recovery could continue despite the re-emergence of the coronavirus in Beijing.

While Hong Kong remains an attractive destination for listing, the city is in the midst of a recession and swirling political unrest, with pro-democracy protests raging for much of the past year.

Beijing has dismissed huge public anger as a foreign plot and has announced plans to impose an anti-subversion law on Hong Kong, which has some businesses worried that the city may lose the autonomy from the mainland that has propelled its economic rise.

China says the law will stabilise the city and reinforce confidence.

Opponents fear it will bring mainland style political oppression given similar laws are routinely used to crush dissent over the border.

On Thursday, state media announced the draft law would be discussed by China's top law-making committee this week.