SHANGHAI — Share prices in China plunged on Friday in one of the sharpest sell-offs in years, accelerating a downturn this last week in what has been, for much of this year, the world’s best-performing stock market.

China’s two major market indexes fell in tandem. The Shanghai composite fell 7.4 percent on Friday. The Shenzhen composite fell even more, dropping 7.9 percent. Share prices in Hong Kong, which is regulated separately, also fell, by 1.8 percent.

Analysts had been warning for months about the risks of a stock market bubble in China, where giddy investors have driven up stock prices by purchasing shares on margin, or with money borrowed from brokers.

China’s market has been an anomaly. Even though the broader Chinese economy has been relatively weak, share prices of many Chinese-listed companies have skyrocketed in the last year. Many traded at record valuations, often 80, 90 or 100 times their projected earnings.