China on Monday adopted a controversial cybersecurity law to counter what Beijing says are growing threats such as hacking and terrorism, although the law has triggered concern from foreign business and rights groups.

The legislation, passed by China's largely rubber-stamp parliament and set to come into effect next June, is an "objective need" of China as a major internet power, a parliament official said.

Overseas critics of the law argue it threatens to shut foreign technology companies out of various sectors deemed "critical," and includes contentious requirements for security reviews and for data to be stored on servers located in China.