BEIJING—The Chinese government struggled in vain Wednesday to prevent the distress in the country’s stock markets from spreading, as it openly fought market forces it has pledged to give a larger role.

Early Wednesday, the Chinese authorities rushed out another raft of emergency measures to halt what is turning into a crisis of confidence in leaders’ ability to steer the economy. But before the day was over the equities selloff had spilled into offshore trading in the Chinese yuan and worsened a drop in global commodity prices.

...