SAN FRANCISCO — China has violated an accord it signed with the U.S. three years ago pledging not to engage in hacking for the purpose of economic espionage, a senior U.S. intelligence official said Thursday.

The 2015 bilateral agreement had significantly reduced the amount of Chinese cybertheft targeting American companies, but Beijing’s commitment to the deal has eroded, said Rob Joyce, senior adviser for cybersecurity strategy at the National Security Agency.