The Digital Economy Act, hurried through Parliament in April 2010 as part of the pre-election "wash-up" period, attracted criticism for its provision allowing the courts to cut off the internet access of users who persisted in sharing copyrighted material.
The judicial review of the act was sought by telecom providers BT and TalkTalk in July last year, after they complained that the law could lead to millions of customers having their privacy invaded. They argued that the law had received "insufficient scrutiny" in Parliament.
A spokesperson for the Department for Culture, Media and Sport, said today: "We are pleased that the court has recognised these measures as both lawful and proportionate.
"The Government remains committed to tackling online piracy and so will set out the next steps for implementation of the Digital Economy Act shortly."
BT and TalkTalk are now considering whether to appeal against the judgement.
Justice Kenneth Parker rejected BT and TalkTalk’s claim that the measures in the act were not compliant with EU law and were not proportionate.
The judge also ruled that internet service providers could be made to pay a share of the cost of the Act’s mass-notification system and appeals process. However, they will not have to pay Ofcom’s costs for setting it up, monitoring and enforcing it.
TalkTalk, in a statement, said: "We are reviewing this long and complex judgement and considering our options, which may include an appeal to the Court of Appeal, or a request that the Court of Appeal make a reference to European Court of Justice.
"Though we may have lost this particular battle, we will continue fighting to defend our customers’ rights against this ill-judged legislation."
A BT spokesperson said: "We are disappointed with the outcome of the Judicial Review. We are reviewing this long and complex judgement. Protecting our customers is our number one priority and we will consider our options once we have fully understood the implications for our customers and businesses."
In February, the Government asked Ofcom to assess whether the Digital Economy Act’s site-blocking measures were workable. Ofcom is due to report to the Government shortly.