Expansion in China’s factory sector slowed in June, as export demand weakened while supply bottlenecks held back production, official data showed Wednesday.

Equally worrying, China’s services sector, a persistent laggard in the country’s post-pandemic rebound that Beijing policy makers are eager to see drive more of the economy, softened as recent coronavirus outbreaks again hindered consumer spending.

The hints of weakness on both fronts come as economists lowered expectations for growth in the world’s second-largest economy. In recent weeks, Morgan Stanley and Barclays, among others, have downgraded their forecasts for China’s full-year gross domestic product to below 9%, citing the impact of higher raw material prices on production and weaker-than-expected consumption.

On Wednesday, China’s National Bureau of Statistics said its official manufacturing purchasing managers index fell slightly to 50.9 in June, from 51.0 in May.

The gauge was higher than the 50.7 median forecast expected by economists polled by The Wall Street Journal and remained above the 50 mark that separates expansion from contraction for a 16th straight month. But it marked the lowest reading in four months.

Beneath the headline number, the subindex measuring production declined to 51.9 in June, from 52.7 the previous month, as recent shortages of semiconductors, coal and power held back output at many factories, the statistics bureau said.

As they have all across the global auto supply chain, chip shortages have hit China’s car makers, keeping the auto manufacturing subindex in contractionary territory for two straight months.

The subindexes measuring the oil, coal and metal industries also weakened, weighing on total demand, officials said.

Recent Covid-19 cases in the southern province of Guangdong, an economic and export stronghold, have added strains to supply bottlenecks for manufacturers.

Operations at Shenzhen’s Yantian Port, one of the world’s busiest, were cut to 30% of capacity beginning in late May and have only started to recover in recent days, according to port officials.

Meantime, the subindex of new export orders fell deeper into contractionary territory to 48.1 in June from 48.3 in May, signaling weakening external demand for Chinese goods.

As the first major economy to emerge from the pandemic last year, China benefited from robust global demand for its export goods, which helped China’s export sector continually defy market expectations.

Now, economists see the trend turning as the lifting of pandemic restrictions in Western countries drives a shift in wealthy consumers’ spending, away from purchases of big-ticket items and more toward in-person services, says Sebastian Eckardt, lead China economist at the World Bank.

As that shift takes root, the contribution of net exports to China’s overall growth will likely wane, Mr. Eckardt says. The World Bank projects China’s current account surplus, which includes foreign trade of merchandised goods and services, to fall to roughly 1.4% of gross domestic product this year, from 1.9% last year.

As exports slow, Mr. Eckardt says he expects to see “import growth recovering in China on the back of firming domestic demand.” Chinese leaders, too, have called for the economy to shift more toward domestic consumption.