BEIJING — China’s leader sent a strong message: the Chinese currency could be used as a weapon in the trade war.

By allowing the Chinese currency to weaken past a key level this week, China’s leader, Xi Jinping, is adopting a hard-line stance, in what is turning into a long-lasting duel between two economic superpowers.

The Chinese leader had little choice, in the face of what he sees as a quixotic, emotion-driven President Trump, Chinese analysts say. He needs to appear strong, to preserve his firm grip on the political apparatus and public propaganda machine. He must also deal with the weight of history that contends the Communist Party must not bend to foreign nations.

And he is willing to take action, even if it means enduring the economic fallout. As the economy slows, he risks inflicting serious damage by running up a huge debt load without the growth to justify it.