The Zeit Berlin German Restaurant inside Beijing’s aging Royal Palace Hotel is the kind of place foreigners can go without attracting much attention. For the German auto executives huddled here on a Wednesday night in late September eating currywurst and downing Hefeweizen beer, that may be the allure. Over the past two months Germany’s carmakers have come under increasing fire in China: Regulators fined Volkswagen’s Audi joint venture $41 million for unfair pricing and announced an investigation into Mercedes-Benz as they continued probing BMW. The automakers, which control nearly 80% of the Chinese premium market and earn large profits here, suddenly found themselves government targets. Their monthly meeting has become part networking event, part therapy session.

“What can you do?” says a BMW finance exec standing in the back of the restaurant as someone from Volkswagen flips through PowerPoint slides of new leasing options in the country. “They’re going after everyone.”

In the past year, Chinese investigations into foreign companies have multiplied dramatically. The number of multinationals in the headlines—and the far bigger fines they have incurred compared with Chinese firms under a six-year-old antimonopoly law—has prompted fears inside the world’s boardrooms that China is going after foreign companies.

The list of targets reads like an all-out assault. Over the summer, six infant milk powder companies, including Illinois-based Mead Johnson Nutrition and Abbott Laboratories, were accused of price fixing and fined $110 million. Then contact-lens makers, including Johnson & Johnson, were fined $3 million for setting minimum prices. Twelve Japanese auto-parts makers were fined $200 million for price fixing this summer. GlaxoSmithKline was fined $490 million in September after a yearlong case in which it was found to have bribed doctors to sell its drugs. After a one-day trial held in secrecy, GSK’s former China head was set to be deported to Britain. Like Volkswagen, the rest of the German automakers are expected to pay hefty fines. Microsoft is being investigated for “monopolistic behavior.” And Qualcomm is facing a possible fine of more than $1 billion for antitrust practices.

“There’s never been anything like this,” says Jim McGregor, who has worked in China for two-and-a-half decades, first as a Wall Street Journal bureau chief, then as CEO of Dow Jones in China, and now as Greater China chairman of APCO Worldwide, an adviser to multinationals. “This is clearly a concerted campaign. Foreign business is being targeted, and so the multinationals are the most negative on China that I’ve seen in 25 years.”

McGregor and others don’t believe the investigations started as an explicit policy by Beijing to pressure foreign companies. Rather, a confluence of events seems to be driving them. The first is political. The administration under President Xi Jinping and Premier Li Keqiang took over a Communist Party rife with corruption nearly two years ago. Their unprecedented campaign against thousands of comrades, including a former member of China’s top Politburo Standing Committee, has shifted to the next target on behalf of average citizens: “greedy multinationals.”

Second, Chinese regulators are scrambling to stay relevant amid reforms. The country’s leaders proposed reducing China’s dependence on state planning in favor of market forces last year during the country’s agenda-setting Third Plenum session. “You’ve got regulators out there desperately trying to prove their worth,” says McGregor. One of the regulators using China’s antimonopoly law against foreign companies, the National Development and Reform Commission, happens to also direct state planning.


THE NEW RULES FOR DOING BUSINESS IN CHINA

CHINA-US-MONOPOLY-INVESTIGATION-MICROSOFTPhoto: Greg Baker—AFP/Getty Images

1. Differentiate yourself: Beijing has welcomed Telsa with open arms because the government is eager to popularize electric vehicles. “What are you doing for China?” says Jim McGregor, author of One Billion Customers. “You have to tell your story so you’re not the ripest target.”

2. Don’t expect due process: In China’s crackdown on government corruption, officials are being detained without charges. Antitrust investigations won’t be totally different. Prepare for it. “I can guarantee Microsoft and McDonald’s see this as a cost of doing business,” says Adil Husain of consultancy Emerging Strategy in Shanghai.

3. Hang tough.: McGregor included advice in One Billion Customers that rings true today: “The Chinese will ask you for anything because you just may be stupid enough to agree to it. Many are.” Don’t be..


What’s more, it appears the new antimonopoly law is being used to implement industrial policy. China’s attitude toward paying royalties on patents has long been, “Why are we paying to use technology we build?” By going after Qualcomm for chip prices, the government is reducing costs and opening the market for domestic “national champions” like Huawei. “There’s a clear pattern of using the antimonopoly law to favor Chinese licensees of intellectual property,” says Jones Day antitrust lawyer Sébastien Evrard in Hong Kong.

Foreign investigations have sparked a war of words in the media and in government halls. The European Union Chamber of Commerce in China came out firing first in August, saying its companies were being forced into confessions of guilt without due process. “Competition law should not be used as an administrative instrument to harm targeted companies,” the Chamber said. The U.S. Chamber of Commerce in China followed up a month later, releasing a survey in which half of responding companies said they believed foreign firms were being singled out in attacks. Then U.S. Treasury Secretary Jack Lew joined the fray, reportedly writing a letter to his Chinese counterpart warning him that the investigations were sending the two countries down a dangerous path.

The backlash has grown so vehement that China is taking the rare step of responding to criticism. In September, Premier Li, the country’s second most powerful leader, said that only 10% of antimonopoly investigations involved foreign companies. Two days later, on Sept. 11, the country’s three regulators in charge of enforcing the antimonopoly law staged a press conference to reinforce the message. “Based on facts under the antitrust laws, we will investigate companies,” said the NDRC’s antimonopoly head, Xu Kunlin.

Even if that percentage of foreign investigations is accurate—and there are reasons to doubt it, not least because China hasn’t released the full slate of investigations, and foreign firms have incurred far bigger fines than domestic companies—the investigations are scaring foreign companies for other reasons. An antitrust lawyer working in China told Fortune that the NDRC is widely known for bullying: It encourages companies not to bring lawyers to meetings, often doesn’t inform firms what they are being charged with, and tries to force them to sign written confessions. “We’ve had conversations with some of the antitrust officials in China who have indicated that they view even the request to have a lawyer present as an indication of guilt,” says Erin Ennis, vice president of the U.S.-China Business Council. The NDRC declined to comment to Fortune.

The case against Microsoft is a window into the regulators’ strong-arm tactics. Almost no other foreign company has as good a relationship with the Chinese government as Microsoft. In 2006, when then-President Hu Jintao visited the U.S., he stopped at Bill Gates’ 40,000-square-foot house for dinner before traveling to Washington to meet President Bush. Fast-forward to this summer, when investigators from the State Administration for Industry and Commerce, another regulator in charge of the antimonopoly law, raided Microsoft’s Beijing offices and those of Accenture searching for evidence of monopolistic practices by Microsoft. (Accenture is not under investigation by the SAIC.)

The state press announced that Microsoft’s use of anti-piracy software codes may have violated the antimonopoly law. Regulators also gave Microsoft 20 days to explain questions about Windows’ compatibility issues—this for a company that sells only about one out of 10 of its products being used in the country because of piracy and that (not coincidentally) once said it earned less in China than in the Netherlands.

“The anti-piracy code was pointed out as the means of controlling the market—which just doesn’t make sense,” says Duncan Clark, who’s worked in China for 20 years advising private equity and hedge fund investors in the tech sector at his firm, BDA. The investigation seems almost farcical, he says, but then regulators have different motives. “They’re playing to the gallery. They want to be seen as tough on foreign companies—if they get big fines, investigations, that’s great. What happens now is where it gets more interesting.”

That’s because China runs the risk of alienating foreign partners. Foreign direct investment in China tumbled to a four-year low in August, driven by a decline in the first eight months of the year in investment from Japan by 45%, from Europe by 18%, and from the U.S. by 17%. You can’t directly link falling investments to investigations, especially because China’s slowing GDP growth (this year economists expect the government’s goal of 7.5% growth to be a stretch) also influences how much money foreigners plow into the country. But taken together, they’ve cooled excitement in the Middle Kingdom.

 A Decrease in Velocity China's economic growth has slowed in recent years, and in 2014 the pace of foreign investment has fallen off as well. A Decrease in Velocity China’s economic growth has slowed in recent years, and in 2014 the pace of foreign investment has fallen off as well.Graphic Source: National Bureau of Statistics of China via Bloomberg

Government pressure on foreign companies in China is hardly new. In the aftermath of the global financial crisis, China invoked protectionist policies. Before 2009, for instance, the country’s wind-turbine-manufacturing market was dominated by foreign operators, which had 40% market share and the technical know-how. After the financial crisis and China’s $600 billion stimulus package, turbines were required to be sourced from domestic suppliers, and new technical requirements often disqualified foreigners. Local governments in charge of growing the nation’s wind farms “legally washed us out,” says Wolfgang Jussen, former CEO of Germany’s Repower in China. Foreigners’ share of the turbine market fell to 10%. Repower, a midsize turbine manufacturer, stopped production in 2011.

That’s not to say that all of today’s cases against foreigners lack merit. The automakers, for instance, cut prices for some spare parts by 50% after the investigations. They now may be forced to allow their dealers to use non-original spare parts, something the European Commission has taken issue with in the past.

Despite the anti-foreign news, China is still the top overseas destination for companies. “We see the sheer consumer demand here, with 1.4 billion people now, and we cannot neglect it,” says Kurt Keller, president of Asia Pacific for Cleveland-based Parker Hannifin, which makes parts for planes and bulldozers. Dozens of companies say the same. For the most part, even companies under pressure aren’t leaving. “Shareholders anywhere else in the world wouldn’t understand if you did,” says Adil Husain, who runs a consultancy in Shanghai advising multinationals.

But Western execs wonder whether the current crackdown represents the new normal or a crisis to be endured. “I doubt this could go on for more than two, three years,” says CJ Liu, a former VP of Nokia China who runs an executive consultancy in Beijing. “This is the Chinese way—the political and social reforms come and go and come and go.” For the moment, foreigners are hunkered down, waiting for it to pass.

This story is from the October 27, 2014 issue of Fortune.

An earlier version of this story did not make it clear that China’s State Administration for Industry and Commerce visited Accenture’s office to collect documents related to Microsoft. The story has been updated to clarify that Accenture is not under investigation by the SAIC.