SEOUL — North Korea accused the United States on Friday of circulating “preposterous falsehoods” and conducting a vicious smear campaign, after Washington charged an alleged hacker for the North Korean government in connection with major cyberattacks, including a 2014 assault on Sony Pictures Entertainment.

The angry rhetoric against Washington came in stark contrast to the latest sign of warming ties between North and South Korea as they opened a new liaison office near the border.

The North Korean statement, signed by a researcher at a Foreign Ministry institute, said the charges could undermine the implementation of agreements reached between President Trump and North Korean leader Kim Jong Un in Singapore in June.

“The U.S. is totally mistaken if it seeks to gain anything from us through preposterous falsehoods and highhandedness,” Han Yong Song at the Foreign Ministry’s Institute for American Studies said in a statement carried by the state-run Korean Central News Agency.