BEIJING — With U.S. trade talks at a delicate moment, China hurriedly passed a foreign investment law Friday meant to placate Americans amid some skepticism from Western business groups.

China’s largely ceremonial parliament, the National People’s Congress, overwhelmingly passed the law that sought to stiffen prohibitions against Chinese officials and companies pilfering trade secrets.

It would also open up more sectors for foreign investment and strive — in broad strokes — to protect the “legitimate rights and interests” of foreign firms.

As votes were cast at the Great Hall of the People on Friday morning — with just a handful in token opposition — state media sprang into action touting the bill’s benefits for foreign companies and highlighting how efficiently it moved through the Chinese bureaucracy in recent months. The measure was tweaked as recently as this week in what was widely seen as an effort by Beijing to address a core complaint raised by Washington’s trade negotiators and foreign business groups.

But the response Friday was lukewarm.

“The last-minute efforts are appreciated, but the changes shouldn’t have been controversial in the first place and only address a small slice of the overall set of concerns our members have about the uneven playing field foreign companies encounter in China,” said Tim Stratford, chairman of the American Chamber of Commerce in China.

The business groups’ response to the legislation mirrors in many ways their concerns about the unfolding trade talks: Several U.S. lobbies have publicly urged President Trump against rushing into a vague deal with China that fails to resolve fundamental complaints about China’s unfair competitive practices — or fails to offer enforceable guarantees that China will live up to its word.

Hours after the investment law passed, Chinese Premier Li Keqiang told reporters that China’s cabinet would soon reveal more details and regulations about how it intended to implement the law, which goes into effect in January. He urged patience.

“I have said many times that China’s opening-up measures are often not launched as one package; they come out every year and even every quarter,” Li said. “Then you turn around and realize they’ve cumulatively had an unimaginable effect.”

The Chinese law came at the end of a week when the Trump administration cooled the temperature on talk of an imminent trade deal. U.S. Trade Representative Robert E. Lighthizer told the Senate on Tuesday that there are “major, major issues that have to be resolved” and that he was not certain a deal could be thrashed out, but would know soon.

An expected meeting with Chinese President Xi Jinping at Trump’s Mar-a-Lago resort to finalize the agreement has been delayed to April — if it happens at all, Bloomberg News reported Thursday. Less than a day later, China’s state news agency, Xinhua, put out an optimistic report that “concrete progress” had been made in the negotiations.

Beyond extending an olive branch to Washington, the investment law will come into force at a time when China is looking to shore up its attractiveness to foreign investors broadly.

The European Chamber of Commerce said Friday that it objected on principle to the Chinese system still maintaining distinctions between foreign and Chinese companies. “More than anything else, foreign companies want equal treatment and opportunities,” said the chamber’s president, Mats Harborn. “While not all of our concerns were addressed in this law, it is time to move forward.”“Southeast Asian countries like Vietnam, they are all developing and attracting foreign investments,” said Yao Xinchao, a professor at the University of International Business and Economics in Beijing. “It's not about confidence in China becoming less attractive; it’s that every other country is catching up.”

Foreign investment in China grew at a slower pace in 2018, and one survey by an American Chamber of Commerce in southern China said two-thirds of U.S. firms in that manufacturing hub were looking to delay or cancel investments in China and were looking at India and Vietnam instead.

Yao said the trade dispute was the “fuse” that sparked the government effort to beef up intellectual property protection laws and placate foreign investors.