"We do not make this allegation lightly", he added. "These disruptions put lives at risk", Bossert wrote.
Wanna Decryptor, also known as WannaCry or wcry, was the ransomware programme used in the attack. "When we must, the United States will act alone to impose costs and consequences for cyber malfeasance", Bossert added.
British security officials suspected that North Korea was behind the WannaCry attacks, linking them to a group called Lazarus that was also behind the 2014 cyberattacks on Sony Pictures, the BBC reported in June.
Bossert also warned that North Korea's "malicious behavior" has been ramping up, but that the USA government intends to respond. "The tool kits of totalitarian regimes are too threatening to ignore".
Bossert is expected to brief reporters on Tuesday about the hacking. But it added: "When we must, the United States will act alone to impost costs and consequences for cyber malfeasance". He implored private companies to build up their defenses against North Korea and other "bad actors" in cyberspace, and singled out Microsoft in particular for taking actions last week to "disrupt activities of North Korean hackers", without elaborating on the details.
Microsoft did not immediately respond to a request for comment.More news: DAR Joins In National Wreath-Laying Ceremony
More news: Bound Honda Insight Prototype Previews All-New 2019 Model
More news: Trump considered pulling Gorsuch's nomination after personal criticism
"Mr. Trump has already pulled many levers of pressure to address North Korea's unacceptable nuclear and missile developments, and we will continue to use our maximum pressure strategy to curb Pyongyang's ability to mount attacks, cyber or otherwise", he wrote.
President Donald Trump's administration is publicly blaming North Korea for a ransomware attack that infected hundreds of thousands of computers worldwide in May and crippled parts of Britain's National Health Service.
The WannaCry ransomware that affected millions of Windows machines earlier this year hardly needs an introduction.
"After careful investigation, the US today publicly attributes the massive "WannaCry" cyberattack to North Korea", Bessert writes.
The official noted that the USA government has released technical details of North Korean cyber tools and operational infrastructure, and has worked with other countries to lessen North Korea's ability to conduct further tests or generate illicit funding.
"What we see is a continued pattern of North Korea misbehaving, whether destructive cyber attacks, hacking for financial gain, or targeting infrastructure around the globe", the official said.