In early 2020, as the pandemic pushed it to the verge of bankruptcy, China’s highest-profile rival to Tesla Inc. was shunned by the venture capital funds and foreign investors that had powered its rise. So Nasdaq-listed Nio Inc. turned to China’s newest class of venture capitalists: Communist officials.

The municipal government of Hefei, a city in eastern China, pledged 5 billion yuan ($787 million) to acquire a 17% stake in Nio’s core business. The company moved key executives from Shanghai to the city, which is less than half the size and 300 miles inland, and began producing more vehicles there. The central government and Anhui, Hefei’s province, joined the city, making smaller investments.

It might look like the kind of power grab some observers see as characteristic of President Xi Jinping’s China: an assertive state enforcing an ever-growing list of dictates on innovative private companies that are destined to discourage entrepreneurship. But the story didn’t play out that way. Nio turned its first profit in early 2021 and sold more than 90,000 vehicles by the end of the year. Rather than leveraging its stake to assert control, the Hefei government took advantage of Nio’s booming share price to cash out most of its stake within a year of its purchase — making a return of up to 5.5 times its investment — much like a private investor in London or New York might have done.