WASHINGTON — The Justice Department has charged a computer programmer working on behalf of the North Korean government with the hack of Sony Pictures Entertainment in 2014, along with the massive Wannacry ransomware attack last year and an $81 million theft from a bank in Bangladesh.

The department identifies the programmer as Park Jin Hyok.

Assistant Attorney General John Demers says it was one of the most complex cybercriminal investigations conducted by the department.

A Sony spokeswoman declined comment.

The U.S. government has previously said that North Korea was responsible for the cyberattack, which resulted in the disclosure of tens of thousands of leaked emails and other materials.

The FBI has said it had detected communications between computer internet addresses known to be operated by North Korea and hacking tools left behind at the crime scene, which officials said contained subtle clues linking those tools to the North Korean government.

The Justice Department in recent years has charged hackers from China, Iran and Russia in hopes of publicly shaming other countries for sponsoring cyberattacks on U.S. corporations.

In 2014, for instance, the Obama administration charged five Chinese military hackers with a series of digital break-ins at American companies, and last year, the Justice Department charged Russian hackers with an intrusion at Yahoo Inc. that affected millions of email accounts.

U.S. officials believed the Sony hack was retribution for “The Interview,” a comedy film that starred Seth Rogen and James Franco and centered on a plot to assassinate North Korea’s leader, Kim Jong Un. Sony canceled the theatrical release of the film amid threats to moviegoers but released it online through YouTube and other sites.