BEIJING — China’s leader, Xi Jinping, seemed confident three weeks ago that a yearlong trade war with the United States could soon subside, handing him a potent political victory.

He even made a speech saying China would protect intellectual property, encourage foreign investment, and buy more goods and services from abroad — all changes the United States had been demanding as the countries tried to negotiate a deal.

But just a week after that speech, Chinese negotiators sent the Americans a substantially rewritten draft agreement, prompting President Trump to accuse Beijing of reneging on terms that had been settled.

That has left hopes for a historic breakthrough in tatters.

In China’s top-down political system, where President Xi has amassed formidable power, it’s unlikely that anyone else would have had the authority — or, for that matter, the nerve — to fundamentally alter the emerging pact at this late date.