HONG KONG — For nearly three years, President Xi Jinping of China has crushed opposition by silencing and often locking up anyone who dares defy the government. But that aura of invincibility has been shaken by stock market speculators who have made a mockery of efforts to halt a steep slide in share prices.

The losses — Chinese shares have shed more than a quarter of their value in three weeks — pose an added risk, and possibly greater danger, to a global economy grappling with Greece’s difficulties in repaying foreign loans and its possible exit from the euro. About $2.7 trillion in value has evaporated since the Chinese stock market peaked on June 12. That is six times Greece’s entire foreign debt, or 11 years of Greece’s economic output.

Skeptical investors have so far shrugged off each step the government has taken to keep share prices aloft: an interest-rate cut, threats to punish rumormongers, allowing the national pension fund to buy stocks and even plans to investigate short-sellers who have placed bets that the market will fall.

The faltering of these measures has put an embarrassing dent in the halo of unruffled supremacy built up around Mr. Xi’s administration, and this past weekend his government doubled down again, betting that it could beat bearish market sentiment into submission.