WASHINGTON — North Korea engaged in a yearslong effort to hack into American companies and steal from financial institutions around the globe, the Justice Department charged on Thursday in a 174-page criminal complaint that detailed how hackers caused hundreds of millions of dollars’ worth of damage to the global economy.

Only one North Korean, Park Jin-hyok, was named — charged with computer fraud and wire fraud in the 2014 hack of Sony Pictures Entertainment. But the complaint described a team of hackers for North Korea’s main intelligence agency, in many cases operating out of China and other Asian nations, who crippled Britain’s health care system in last year’s WannaCry attack and stole $81 million from the Bangladeshi central bank — a heist that would have reaped $1 billion, save for a spelling error — before turning to vulnerable institutions from Vietnam to South Africa.

North Korea seemed primarily motivated by its continuing need for cash, as other countries have refused to do business with Pyongyang, and a desire to control American corporate behavior through fear. WannaCry presented the possibility that the North also wanted to sow chaos.

The complaint was the most specific public accounting yet of North Korea’s cyberattacks against other countries. The Justice Department has now brought charges against state actors from North Korea, China, Iran and Russia, the United States’ most formidable cyberfoes.