LONDON—British officials blamed Russia for last June’s massive “Petya” cyberattack, which crippled computer networks at multinational firms including FedEx Corp., container-ship giant A.P. Moeller-Maersk A/S and pharmaceutical firm Merck & Co.

Ukraine, which bore the brunt of the attack, accused Russia at the time of orchestrating the attack. Wednesday’s allegations by London represented the first time a major Western government has pinned blame on Moscow for the incident.

...