By Liza Lin and Dave Sebastian

Chinese e-commerce giant Alibaba Group Holding Ltd. said its fiscal first-quarter profit more than doubled from the same period a year earlier, mirroring the results of U.S. tech giants that have thrived as disruption from the coronavirus pandemic accelerated a migration online.

Alibaba, China's most valuable technology company with an already central position in Chinese society, reported net income of 47.6 billion yuan ($6.8 billion) for the quarter ending June as more shoppers bought daily necessities and other products online. Revenue rose 34% to 153.8 billion yuan, exceeding expectations of 148 billion yuan by analysts polled by FactSet.

Like its U.S. peer Amazon.com Inc., the Hangzhou-based technology giant, which runs two of China's most popular e-commerce websites, benefited as a shift in consumers' shopping habits became more entrenched during widespread lockdowns due to the virus outbreak. In the U.S., retailers of basic necessities and goods such as Target Corp. and Walmart Inc. this week also reported sharp jumps in their online sales.

Chinese consumers already make more purchases on the internet than their global peers. Yet, the outbreak accelerated a move by older consumers and those in smaller Chinese cities to shift their buying from physical stores to online platforms, said Steven Zhu, an analyst at research firm Pacific Epoch.

"The coronavirus has been good for Chinese e-commerce players," Mr. Zhu said. "Once you switch, you don't switch back."

China's economy rebounded from a contraction in the first three months of 2020, growing more than 3% in the second quarter, making it the first major economy to return to growth since the start of the pandemic.

Still, Daniel Zhang, Alibaba's chairman and chief executive officer, indicated that uncertainties from the pandemic as well as a ramp-up in tension between the U.S. and China loom over the company's operations.

In an investor call after the earnings report, Mr. Zhang said Alibaba was closely monitoring the latest shifts in U.S. government policies toward Chinese companies, calling it "a very fluid situation."

Earlier this month, U.S. President Trump issued executive orders barring companies and people in the U.S. from transactions with Tencent Holdings Ltd.'s Wechat and Bytedance Inc.'s TikTok apps starting Sept 20. President Trump has said he is considering extending the ban to other Chinese companies.

Thursday's results mark a recovery from a tepid January-to-March earnings quarter, when Alibaba's profits tanked as the pandemic affected the value of its public investments. Earnings in that quarter fell 88%. Beyond its retail marketplaces, the company also runs a cloud services division and digital media platforms.

Alibaba, which counts more than 800 million monthly active users on its mobile retail platforms, reported Chinese consumer spending remains strong. China commerce retail sales grew 34% from a year ago to 101 billion yuan.

"Our domestic core commerce business has fully recovered to pre-Covid-19 levels across the board," Alibaba's Chief Financial Officer Maggie Wu said Thursday.

As the coronavirus led to widespread city lockdowns earlier this year, more Chinese consumers turned to e-commerce and their platforms to buy fresh food and groceries online to cook at home, Alibaba's CEO Mr. Zhang told investors in May. This helped offset a drop in spending on clothing and cosmetics, he said.

In the June quarter, the company also benefited from a midyear shopping festival for which it ran numerous marketing campaigns and dangled promotions to encourage spending.

The company has also introduced new ways to market its products to fight off competition from its rivals such as JD.com Inc., including live-streaming product demonstrations and sales pitches.

Another bright spot for the Chinese technology juggernaut was its loss-making cloud-computing division. Revenue in the segment grew 59% to 12.3 billion yuan in the quarter as a growing number of businesses ramped up efforts to digitize their operations. Alibaba's digital media and entertainment unit also posted a 9% rise in sales for the June quarter.

Adjusted earnings per American depositary share were 14.82 yuan. Analysts polled by FactSet were expecting 13.82 yuan a share.

Analysts from JPMorgan Chase & Co. said in an August report that geopolitical friction between the two major economies may negatively impact the growth of Chinese internet companies such as Alibaba, Tencent Holdings and NetEase Inc. in the mid-to-longer term as they face hurdles to international expansion. Chinese companies may divert their growth efforts inward instead, leading to more aggressive competition and lower industry profits within China, they wrote.

Geopolitical tension has already resulted in Alibaba closing the Indian operations of its mobile browser UCWeb. Indian authorities banned UCWeb products and dozens of other Chinese apps after a border clash between troops from the two countries left 20 Indian soldiers dead this month.

Mr. Zhang said on the call the closure wouldn't materially affect Alibaba's financial performance.

Write to Liza Lin at Liza.Lin@wsj.com and Dave Sebastian at dave.sebastian@wsj.com