Russian antivirus-software company Kaspersky Labs said it would relocate significant operations from Russia to Switzerland, after the U.S. and U.K. governments said the company could be vulnerable to Moscow interference.

The $12 million move comes amid growing tensions over cybersecurity that pit the U.S. and some of its allies against their geopolitical antagonists, including Russia and China. Kaspersky is among several companies that have been swept up in the fallout. Other casualties have included China’s Huawei Technologies...