BERLIN (Reuters) - Germany’s ruling coalition has agreed on a new draft law designed to remove all legal risks associated with providing free Wi-Fi to the public, government sources told Reuters on Tuesday.

Many cafes and restaurants currently restrict Wi-Fi access since they run the risk of being made liable if users carry out illegal activities such as copyright infringement while using their connection.

Under the new law, hotspot providers will no longer be held responsible if users do forbidden things such as breaching copyright by downloading songs or films illegally.

The law also removes the risk that providers will be forced to fork out for claims to damages and written warning letters from lawyers if users commit crimes.

The agreement follows months of wrangling between Chancellor Angela Merkel’s Christian Democrats (CDU) and her junior coalition partner, the Social Democrats (SPD), over the new law.

Earlier versions of the new law had required Wi-Fi providers to protect their connection with a splash page or passwords, measures critics derided as cumbersome and counterproductive.

Germany’s restrictive rules have been blamed for the poor availability of public Wi-Fi.

Europe’s biggest economy currently has only 1.87 Wi-Fi hotspots per 10,000 residents, compared to 37.35 in South Korea, 28.67 in Britain and 9.94 in Sweden, the German government says.

Better internet access is viewed as a crucial part of Germany’s so-called Digital Agenda, which aims among other goals to provide all households with download speeds of at least 50 megabits per second by 2018.

The German lower house of parliament is due to vote on the law on Thursday and it is expected to come into force this summer at the latest.