BEIJING — China took a major step on Thursday in President Xi Jinping’s drive to impose greater control and limit Western influences on Chinese society, as it passed a new law restricting the work of foreign organizations and their local partners, mainly through police supervision.

More than 7,000 foreign nongovernment groups will be affected, according to state news reports.

Foreign groups working across Chinese civil society — on issues including the environment, philanthropy and cultural exchanges, and possibly even in education and business — will now have to find an official Chinese sponsor and must register with the police. This also applies to groups from Taiwan, Hong Kong and Macau.

Those organizations that do not receive official approval will be forced to stop operating in the country. Many groups will probably curtail or eliminate programs deemed politically sensitive, such as training lawyers, in order to remain.

Groups that may have a hard time getting approval include those promoting workers’ rights, ethnic equality and religious freedoms.