HANOI, Vietnam (AP) — Vietnamese legislators on Tuesday passed a contentious cybersecurity law, which critics say will hurt the economy and further restrict freedom of expression.

The law requires service providers such as Google and Facebook to store user data in Vietnam, open offices in the country and remove offending contents within 24 hours at the request of the Ministry of Information and Communications and the specialized cybersecurity task-force under the Ministry of Public Security.

Addressing the Communist Party-dominated assembly before the vote, chairman of the Committee on Defense and Security Vo Trong Viet said the law is "extremely necessary to defend the interests of the people and national security".

Viet said the law doesn't contradict Vietnam's commitments to multinational trade treaties such as the World Trade Organization and the Trans-Pacific Partnership, but he said there are exceptions on national security grounds.

He said requiring foreign companies to set up data centers in Vietnam may increase their operational costs, but it was necessary for the country's cybersecurity and will facilitate the companies' operations and user activities.

"When there are acts of violation of cybersecurity, the coordination in handling the violations will be more effective and more viable," Viet said, without elaborating.

An estimated 70 percent of Vietnam's 93 million people are online and some 53 million people have Facebook accounts.

Jeff Paine, managing director of Asia Internet Coalition, an industry association that includes Google and Facebook, said that the group was disappointed with the passage of the law whose requirements on data localization, content control and local offices will hinder the country's ambitions to achieve GDP and job growth.

"Unfortunately, these provisions will result in severe limitations on Vietnam's digital economy, dampening the foreign investment climate and hurting opportunities for local businesses and SMEs to flourish inside and beyond Vietnam," he said in a statement.

The Vietnam Digital Communications Association said the law may reduce GDP growth by 1.7 percent and wipe out foreign investment by 3.1 percent.

Facebook did not comment on the new legislation.

The United States and Canada had called on Vietnam to delay the passage of legislation.

The U.S. Embassy said last week it found the draft containing "serious obstacles to Vietnam's cybersecurity and digital innovation future, and may not be consistent with Vietnam's international trade commitments."

Amnesty International said the decision has potentially devastating consequences for freedom of expression.

"In the country's deeply repressive climate, the online space was a relative refuge where people could go to share ideas and opinions with less fear of censure by the authorities," Clare Algar, Amnesty International's director of global operations, said in a statement Tuesday.

She said the law grants the government sweeping powers to monitor online activity, which means "there is now no safe place left in Vietnam for people to speak freely."

"This law can only work if tech companies cooperate with government demands to hand over private data. These companies must not be party to human rights abuses, and we urge them to use the considerable power they have at their disposal to challenge Viet Nam's government on this regressive legislation," she said.

Despite sweeping economic reforms since the mid-1980s that made Vietnam one of fastest growing economies in the region, authorities maintains tight control over almost all aspects of life including the media and religion and tolerate no challenge to the one-party rule.

Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.