Britain believes “quite strongly” that North Korea was behind the “WannaCry” cyberattack in May that wreaked havoc on the National Health Service’s computer systems and spread to more than 150 countries, a senior official said on Friday.

The minister of security, Ben Wallace, told the BBC that several other countries had concluded the same thing: North Korea unleashed “ransomware” that buffeted institutions including universities in China, rail systems in Germany and the Russian Interior Ministry.

“This attack, we believe quite strongly, came from a foreign state,” he said. “North Korea was the state that we believe was involved this worldwide attack.”

Mr. Wallace declined to elaborate on the evidence that had led to the conclusion. “I can’t obviously go into the detailed intelligence, but it is widely believed in the community and across a number of countries that North Korea had taken this role,” he said.