By Jonathan Cheng

BEIJING--A gauge of Chinese business activity outside the factory floor rose to its highest level in 2 1/2 years in August, a sign that Beijing's efforts to stimulate consumption at home are having an impact.

China's official nonmanufacturing purchasing managers index rose to 55.2 in August from 54.2 a month earlier, mainly driven by the service sector, the National Bureau of Statistics said Monday. It marks the sixth consecutive month that the index topped the 50 mark that separates expansion from contraction.

Meanwhile, the manufacturing index, a gauge of China's factory activity, slipped to 51.0 in August, from 51.1 in the previous month, falling slightly short of market expectations, though it, too, remained in expansionary territory for a sixth straight month.

While the nonmanufacturing PMI survey covers a broad variety of industries, including construction and real estate, the subindex measuring business activity in the service sector--a laggard in the broader recovery thus far--rose to 54.3 in August, from July's reading of 53.1.

The subindex measuring construction activity fell slightly to 60.2 from 60.5, while the new-orders subindex for the entire nonmanufacturing sector, a measure of broad demand, rose to 52.3 in August from 51.5 in July.

The nonmanufacturing PMI data are based on replies to monthly questionnaires sent to purchasing executives at 4,000 companies in 37 nonmanufacturing sectors including retail, aviation, software, real estate and construction.

Economists said the strong improvement in service-sector activity helped alleviate some concerns about a two-track recovery in China, in which factories rebounded to pre-virus levels relatively quickly, fueled by external demand as China gained global market share, but in which services, including restaurants and retail outlets, continued to languish amid lingering fears around the contagion.

With coronavirus cases largely contained within China's borders, says Iris Pang, an economist with ING Bank in Hong Kong, "China's PMIs show that the economy depends solely on its own demand for economic growth."

Ms. Pang said export orders for China's manufacturers would likely continue to fluctuate modestly as factories in other countries come back online, taking back some of the gains China has made in its share of global trade, leaving the country even more reliant on domestic demand to fuel growth.

In recent months, Chinese leader Xi Jinping has called for accelerating the country's shift toward more reliance on its domestic economy, particularly as the world struggles with recession and geopolitical tensions increase.

The improving data released on Monday followed a series of government stimulus policies tailored to support China's virus-hit economy, which suffered a 6.8% contraction in the first three months of the year before bouncing back with 3.2% year-over-year growth in the second quarter.

Although China has refrained from turning to huge stimulus measures, as many other countries have done and as China itself did during the global financial crisis in 2008, the central bank has modestly eased its lending rates, injecting more liquidity into the market. Meanwhile, the government turned to infrastructure projects to boost the economy in the first half of the year.

While many economists have questioned the sustainability of Beijing's reliance on infrastructure spending as a stimulus tool, London-based Capital Economics said Monday in a report to clients that it believed "an investment-led rebound would eventually also shore up consumer sentiment and household spending, keeping the overall economic recovery on track."

Economists at Citi said they still see further upside for Chinese industrial activity, noting the likelihood of more fiscal support in the coming months.

Though Monday's data release was generally positive, there were some reasons for caution. The manufacturing subindex for employment remained mired in contractionary territory for a fourth straight month, suggesting continued weakness in China's labor markets.

The manufacturing subindex for small enterprises also fell deeper into contraction in August, to 47.7, as smaller businesses struggled to recover from the pandemic.

Massive floods have added to the economic misery for many across wide swaths of central and southern China, ruining agricultural production, disrupting business activity and adding to uncertainty as business owners seek to keep their recovery on track.

In China's southwest, where Chongqing and neighboring Sichuan province have been hardest hit by the flooding, "The procurement cycle of raw materials has been lengthened, market orders have decreased and factory production has dropped," said Zhao Qinghe, an analyst at the National Bureau of Statistics.

Across the country more broadly, roughly half of surveyed small enterprises reported insufficient market demand and tightened liquidity, Mr. Zhao said.

Bingyan Wang contributed to this article.

Write to Jonathan Cheng at jonathan.cheng@wsj.com