German Chancellor Angela Merkel on Sunday said Beijing must ensure that the nation's laws are not used as a tool of power.

In a speech at the beginning of her three-day visit, Merkel said China needed a reliable framework for a stable society. She emphasized the need for greater democracy in the world's most populous country.

Chinese Premier Li Keqiang and the German chancellor agreed to communicate about potential issues over a controversial law banning non-governmental organizations (NGO) from financing or engaging in "political activities."

"That is why we … agreed to be in close touch with each other via the foreign ministries or other organizations. I think that is the right way to react initially," Merkel said.

However, human rights groups and foundations have voiced concern over the new law, saying it could hamper their activities within the country when it goes into effect next year.

"The authorities - particularly the police - will have virtually unchecked powers to target NGOs, restrict their activities and ultimately stifle civil society," said China researcher William Nee of Amnesty International.

"The law presents a very real threat to the legitimate work of independent NGOs and should be immediately revoked," he added.

Ahead of the visit, relatives of former Deutsche Welle journalist Gao Yu asked Merkel to discuss her case with Chinese authorities. A Chinese court found the 71-year-old correspondent guilty of espionage in April 2015.

ls/jm (dpa, Reuters, ARD)