Brazilian President Dilma Rousseff ratified a bill Wednesday that guarantees Internet privacy and freedom during an Internet conference in Sao Paulo.

The bill, which was passed late Tuesday by the Senate, put limits on metadata that can be collected from Brazilian Internet users, The Associated Press reports. The legislation also frees Internet service providers from being liable for content that is published by their users and from being required to remove offensive material posted by users.

Brazil has championed Internet freedom since Rousseff found out she was being surveyed by the U.S. National Security Agency. She canceled an October visit to the U.S. over the revelations, which were leaked by former NSA analyst Edward Snowden.

The revelations also disclosed that Brazil's state-run Petrobras has also been spied on by the NSA.

Rousseff signed the legislation into law early Wednesday before her opening speech at the NETmundial conference in Sao Paulo.

Representatives from around the world attended the conference in addition to prominent Internet figures, such as the Google vice president and the head of a U.S.-led organization that coordinates the Internet's naming system.

Rousseff praised the Senate for passing the bill, which she said "guarantees the neutrality of the Web, which is fundamental to maintaining the Internet's free and open nature."

"Our legislation can influence the worldwide debate aimed at finding a way to guarantee real rights in a virtual world," Rousseff said, according to her blog.

Her blog also quoted Justice Minister Jose Eduardo Cardozo, who called the legislation "historic," and a "victory for Brazilian society, for the Brazilian government and for the Brazilian legislature."

"I believe that neutrality, privacy, freedom and the absence of discrimination that the text guarantees are really going to put Brazil in the vanguard, as a model for various other countries that are going to want to recreate the same principles, the same condition that are enshrined in our law," he added.