Brazil's Federal Senate has passed a proposed Internet law that aims to guarantee freedom of expression and privacy to the country's Internet users, and also requires foreign Internet service providers to fall in line with the country's rules.

The bill was passed Tuesday, a day ahead of the start of a global Internet governance conference in Sao Paulo, Brazil, and requires the assent of Brazil's President Dilma Rousseff.

The president has backed the legislation after reports of spying by the U.S. National Security Agency on Internet users as well as top political leaders including herself.

The Global Multistakeholder Meeting on the Future of Internet Governance, also called NETmundial, opens in the wake of disclosures by former NSA contractor Edward Snowden about the agency's surveillance activities. Activists are demanding that the meeting address squarely the issue of Internet surveillance including by the NSA.

The meeting also follows an announcement in March by the U.S. National Telecommunications and Information Administration that it will end by 2015 its oversight of the Internet Corporation for Assigned Names and Numbers (ICANN).

The Brazilian model can influence the global debate to find a path that will guarantee real rights in a virtual world, Rousseff wrote in a Twitter message on Tuesday.

The legislation, known as the "Marco Civil da Internet," was modified by legislators of the Chamber of Deputies in March to remove a provision that would have required foreign Internet companies to host data of Brazilians in the country.( U.S. Internet companies had protested strongly against the provision.

Among the provisions of the Internet law are net neutrality, preservation of user connection data such as IP addresses for one year and the requirement to remove images and videos containing nudity and sex at the request of victims, according to a summary on the senate site. Internet service providers will not be responsible for content posted on their services though they must comply with judicial orders to remove certain content, according to news site Globo.com

John Ribeiro covers outsourcing and general technology breaking news from India for The IDG News Service. Follow John on Twitter at @Johnribeiro. John's e-mail address is john_ribeiro@idg.com