Zhang Yong of the Standing Committee of the National People's Congress answers questions during the press conference held in Beijing Thursday. (Wu Hong/EPA)

Chinese lawmakers on Thursday passed legislation to bring foreign nongovernmental organizations under the direct supervision of the security apparatus, a move that has raised alarm among civic groups, Western governments and business lobbying groups.

The long-delayed law on regulating foreign NGOs was the subject of much debate within the Communist Party and intense lobbying from abroad, but officials said a third draft was finally passed by the Standing Committee of the National People’s Congress.

Despite the lobbying effort, the bill retains the key elements that have caused alarm among people working here to fight poverty and discrimination, offer legal aid and improve health education.

Foreign NGOs will be supervised by the Public Security Bureau, rather than the Ministry of Civil Affairs, which traditionally oversees them. Many fear that the organizations will now be treated more as a security risk, not as a partner of the government.

The NGOs will be subject to tight supervision of their activities and budgets, as well as police spot-checks, and they will face closure if they do anything that China s as undermining state security — essentially, whatever is seen as threatening Communist Party rule.

The new law is part of a broader crackdown on civil society and free speech under President Xi Jinping, who took power in 2013, but it also reflects fears that foreign groups are intent on undercutting China’s one-party state.

Officials insisted, however, that it would not affect the activities of the majority of the nearly 10,000 NGOs operating in the country.

“There’s no need to worry,” Zhang Yong, a member of the NPC’s Legislative Affairs Committee, said at a news conference.

“We have always held a welcoming and supportive attitude toward overseas NGOs that are engaged in friendly activities in China,” he said. “But an extremely small number of NGOs attempt to, or have already engaged in, activities that endanger China’s social stability and state security. Therefore, we need to apply the rule of law to overseas NGOs’ activities in China.”

Similar moves also have taken place in Russia under President Vladimir Putin. Both regimes see the West’s hand in the “color revolutions” that opposed autocratic regimes in the former Soviet Union and in the Balkans in the early 2000s, in the Arab Spring in 2011, and in pro-democracy protests that swept Hong Kong in 2014.

“Beijing is increasingly worried about an ‘infiltration by hostile Western forces,’ meaning Western values and political concepts like autonomous representation of interests or fostering a rule of law,” said Kristin Shi-Kupfer, director of research into politics, society and media at the Mercator Institute for China Studies in Berlin.

But, she said, “the Chinese leadership wants to benefit from the know-how and commitment of foreign nongovernmental organizations in selective areas.”

Members of the Legislative Affairs Committee and an official from the Public Security Bureau said at a news conference that the law was meant to facilitate the work of NGOs in China, not drive them out.

“We spent a year revising the draft to provide better management and service,” the NPC’s Guo Linmao said. “Any NGO, as long as they are friendly and operate according to law, we will protect their legal interests. Don’t be afraid because the Ministry of Public Security is involved.”

Officials repeatedly declined to give examples of NGOs that had endangered state security or of their illegal activities.

Under the new law, which takes effect Jan. 1, foreign NGOs will need to find a government agency to sponsor them, a requirement that could prove tough for some.

They will have to submit an annual work plan and budget to the authorities. Police can check their offices, question employees and examine materials, with the power to seal offices if they find evidence of what they deem illegal activities.

Staffers can be detained for up to 15 days if found to have been inciting the obstruction of justice, making up rumors, slandering, spreading harmful information, funding illegal political or religious activities, or endangering state security.

Criminal charges will be brought if evidence is found of anyone trying to split the country, disrupt national unity or subvert state power.

Some revisions were made to the law to soften its effect, including giving NGOs more freedom in their recruitment, removing a clause that had demanded that they re-register every five years and allowing them more than one representative office in the country. The law exempts collaboration between schools, hospitals, and academic and research institutions.

One European diplomat welcomed those changes but expressed concern that the “sweeping powers of the police” remained in the law.

“We are worried that work for foreign NGOs will be made harder by the law,” the diplomat said, speaking on the condition of anonymity to freely discuss the sensitive subject.

“This will especially affect NGOs that deal with more sensitive areas, such as migrant workers, but also with issues that have been recognized by the political leadership as in need of addressing, such as poverty reduction and environmental protection.”

Some civil society groups fear China’s extremely broad definition of state security — it encompasses almost anything the Communist Party does not like — could be used against them.

Shi-Kupfer said foreign NGOs and their Chinese partners offering legal aid, for example, will face increasing difficulties and possible closure.

Sophie Richardson, China director at New York-based Human Rights Watch, said the law was not designed to protect or emancipate independent voices in China but to produce “authoritarian activism,” or state-approved advocacy or work.

“That’s a blow to all the issues supported by domestic groups across China and many of those around the world who support them,” she said. “And it’s a major rebuke to all those governments, business groups, universities and cultural exchanges who pushed for the law to be dropped.”

The law was approved 147 to 1, with one abstention.

Xu Yangjingjing and Liu Liu contributed to this report.