Legislation giving UK households the legal right to request a fast broadband connection has passed into law.

The Digital Economy Act also modernises the law governing the installation and maintenance of telecoms infrastructure, facilitates public sector data sharing and regulates direct marketing activities, among other provisions. It was one of the last pieces of legislation to be passed by the UK parliament ahead of the early general election on 8 June.

Digital and culture minister Matt Hancock said that the new legislation would "help build a more connected and stronger economy".

"The act will enable major improvements in broadband rollout, better support for consumers, better protection for children on the internet and further transformation of government services," he said.

The act makes provision for a broadband universal service obligation (USO) giving people the legal right to request a connection above a speed of a certain level. This is expected to be set at 10Mbps, after the government rejected a House of Lords amendment setting it at 30Mbps. Consumers and businesses will also been entitled to better information about telecoms services, easier switching and automatic compensation if things go wrong.

The act also contains plans for a new Electronic Communications Code, replacing the one that is currently in force which sets out rights and obligations in relation to the deployment and maintenance of mobile phone masts and other telecoms infrastructure. The new code will only apply to new agreements entered into after it comes into force.

The new code will reduce the freedom of landowners to charge premium prices for the use of their property by telecoms companies, by effectively regulating rent based on the underlying value of the land. It will also make it easier for telecoms companies to upgrade and share their equipment, such as masts or cables, without having to pay landowners extra, unless there is more than a 'minimal adverse impact' on the appearance of the apparatus or the landowner would face an additional burden as a result of the works.

The act will also introduce a new obligation on the UK's information commissioner to set out a code of practice to regulate direct marketing activities. It will also allow for greater sharing and use of citizens' data across the public sector for purposes such as improving the welfare of citizens, aiding research and combating fraud, to be governed by codes of practice.

Further provisions in the act impose new obligations on companies that provide access to online pornography in the UK to ensure that material can only be accessed by adults aged 18 or over; give the government new powers to tackle the use of 'bots' to bypass limits on maximum event ticket purchase limits; and extend the public lending right to cover e-books.

We are processing your request. \n Thank you for your patience. An error occurred. This could be due to inactivity on the page - please try again.