Russian prosecutors have issued warnings to Western companies in Russia, threatening to arrest corporate leaders there who criticize the government or to seize assets of companies that withdraw from the country, according to people familiar with the matter.

Prosecutors delivered the warnings in the past week to companies including Coca-Cola Co., McDonald’s Corp., Procter & Gamble Co., International Business Machines Corp. and KFC owner Yum Brands Inc., the people said. The calls, letters and visits included threats to sue...

Russian prosecutors have issued warnings to Western companies in Russia, threatening to arrest corporate leaders there who criticize the government or to seize assets of companies that withdraw from the country, according to people familiar with the matter.

Prosecutors delivered the warnings in the past week to companies including Coca-Cola Co. , McDonald’s Corp. , Procter & Gamble Co. , International Business Machines Corp. and KFC owner Yum Brands Inc., the people said. The calls, letters and visits included threats to sue the companies and seize assets including trademarks, the people said.

Russian President Vladimir Putin last week expressed support for a law to nationalize assets of foreign companies that leave his country over its invasion of Ukraine. The prosecutors’ warnings were directed at companies across sectors, including technology, food, apparel and banking, the people familiar with the matter said.

The warnings have prompted at least one of the targeted companies to limit communications between its Russian business and the rest of the company, out of concern that emails or text messages among colleagues may be intercepted, some of the people said.

Other companies have moved to transfer executives out of Russia, other people familiar with the matter said.

Spokespeople for Coca-Cola, IBM, P&G and McDonald’s declined to comment. A Yum spokeswoman declined to comment beyond the restaurant company’s past statements on its decision to pause operations at its KFC and Pizza Hut restaurants in Russia.

KFC operating in a Russian shopping center Saturday.

Photo: Maksim Konstantinov/Zuma Press

The Russian Embassy in Washington didn’t respond Sunday to a request for comment.

A parade of companies have announced plans to suspend or scale back their operations in Russia in the wake of Mr. Putin’s invasion of Ukraine and sanctions imposed by Western governments.

Many companies, particularly retailers and manufacturers, have said their decisions to stop operations are temporary. Some said they were necessitated by the disruption that sanctions have had on supply chains. Others have committed to leaving for good.

Companies are also evaluating their business in Russia in a different way given the economic instability and expectations that conditions will be volatile for some time, according to people briefed on the matter. Despite the prosecutors’ warnings, a number of the companies aren’t planning to change their decisions to withdraw or suspend operations, the people said. It would also be difficult for companies to smoothly transfer operations to Russia if the government sought to impose its own managers, one of the people said.

The Russian prosecutor general’s office on Friday said it would ensure that companies that have said they are pausing or exiting operations comply with the country’s labor laws. More than 350 foreign companies have said they are leaving or temporarily suspending work in Russia, according to the Yale School of Management.

Wall Street banks such as Goldman Sachs Group Inc., consumer-goods companies such as Coke, retailers such as Levi Strauss & Co. and tech giants such as Apple Inc. have announced plans to pull back. Energy giants such as BP PLC and Exxon Mobil Corp. said they would exit Russian operations.

Mr. Putin endorsed a plan floated last week by a senior member of his dominant United Russia party to nationalize the operations of Western companies exiting the country. Such a move would help prevent job losses and maintain Russia’s ability to produce goods domestically, said

Andrei Turchak, the secretary of the general council of the United Russia party.

Washington warned against a nationalization effort.

“Any lawless decision by Russia to seize the assets of these companies will ultimately result in even more economic pain for Russia” and might invite legal action, White House press secretary Jen Psaki tweeted Thursday.

Coca-Cola last week said it would suspend operations in Russia. Coke’s business in Russia and Ukraine contributed about 1% to 2% of its operating revenues and income in 2021. The company had an ownership interest of about 21% in

Coca-Cola HBC AG , Coke’s bottling and distribution partner in the region, as of Dec. 31.

Restaurant-owner Yum last week said it was temporarily closing its 70 company-owned KFC locations and signing an agreement with its Pizza Hut franchisee to halt business at its 50 locations. It was also suspending all investment and restaurant development in Russia, the company said.

The company is “focused on the safety of our people in the region and will continue to support our teams in Ukraine while evaluating the ways Yum Brands can make a positive impact in the region,” the spokeswoman said.

IBM Chairman and Chief Executive Arvind Krishna wrote in a blog post last week that the company had suspended all business in Russia. “The safety and security of IBMers and their families in all areas impacted by this crisis remains our top priority,” he wrote.

McDonald’s last week said it was temporarily closing its roughly 850 restaurants in the country and would continue paying the 62,000 people it employs in Russia. The company said it couldn’t yet determine when it might reopen the restaurants in Russia and would consider whether any additional steps might be required.

Closing the restaurants is expected to cost the company an estimated $50 million a month for payroll, leases, supply-chain and other costs, McDonald’s said.

P&G, maker of Pampers diapers and Crest toothpaste, said it would halt spending in Russia on capital investments, advertising and promotions while selling only products that focus on basic health, hygiene and personal care. P&G said that Russia and Ukraine combined account for less than 2% of annual revenue. The company said it employs 2,500 people in Russia.

Write to Jennifer Maloney at jennifer.maloney@wsj.com, Emily Glazer at emily.glazer@wsj.com and Heather Haddon at heather.haddon@wsj.com