France's Senate has approved a bill that will give judges the authority to cut the internet connections of people who have illegally downloaded or uploaded copyright-protected music and video files.

The Senate voted 189-142 late Wednesday for the bill, which now goes back to the lower house of parliament for final passage. Under the terms of the bill, offenders are given "three strikes" before they face a connection shutdown.

People who have illegally downloaded or uploaded files a third time will be referred to a judge, who can either order a one-year connection ban, a fine of up to $490,000, or up to two years in prison.

The bill is a watered-down version of an earlier piece of legislation championed by President Nicolas Sarkozy. The original would have given a government agency — known as Hadopi — the authority to cut connections of offending customers.

French legislators voted to adopt that bill in May.

Legal hurdles

But the following month, the France's legal authority blocked its implementation, calling it unconstitutional.

The bill has generated much heated discussion in France. Critics said it would encroach on personal freedoms and be difficult to enforce. The music and film industry, meanwhile, had pushed for tougher laws to combat online piracy.

Legislators also had to navigate several legal hurdles in coming up with the bill, notably a European Union measure that prohibits EU governments from cutting off a user's internet connection without court approval.

The newest version of the bill essentially sidesteps that obstacle, shifting the onus on making such decisions from Hadopi to the courts.

With files from The Associated Press