TOKYO — Warning of “serious consequences” if the United States retaliates against it over the damaging cyberattack on Sony Pictures, North Korea insisted on Saturday that it was not behind it, and it offered to prove its innocence by taking part in a joint investigation with Washington to identify the hackers.

The message, attributed to an unnamed Foreign Ministry spokesman and carried by North Korea’s state-run news service, appeared to be the secretive government’s response to President Obama’s statement the day before that the United States would take action in response to the hacking, which has shaken one of Hollywood’s largest studios.

American officials said the hackers’ methods and other clues had led them to conclude that North Korea was behind the attack, which resulted in the posting online of confidential Sony emails and some unreleased movies.

The cyberattack and emailed threats of attacks against movie theaters prompted Sony to cancel the Christmas release of “The Interview,” a comedy about a plan to assassinate the North Korean leader, Kim Jong-un. North Korea has previously denied responsibility for the hacking, though it called the attacks a “righteous deed” by its “supporters and sympathizers.”