The government has been given the green light to implement the Digital Economy Act after the final legal challenge by two internet service providers was thrown out at the court of appeal.
BT and TalkTalk on Tuesday lost their appeal against last year's judicial review of the government's controversial anti-piracy legislation on all but one ground.
Three senior judges at the court of appeal ruled that the government could not make ISPs pay a proportion of the case fees attached to the act.
The ruling brings to an end almost two years of legal challenges against the legislation by the ISPs. The government will now be able to compel internet providers to send out warning letters to subscribers accused of illegal filesharing.
Tuesday's court of appeal ruling found that the Digital Economy Act is legal and compatible with European law.
Geoff Taylor, chief executive of the British Phonographic Industry, welcomed the ruling, saying: "The ISPs' failed legal challenge has meant yet another year of harm to British musicians and creators from illegal filesharing."
BT and TalkTalk had complained that the legislation was incompatible with European law and put an unfair burden on them to pay the costs of the rights-holders' crackdown on illicit downloading.
However, the court of appeal judges – Lady Justice Arden, Lord Justice Richards and Lord Justice Patten – agreed with an earlier high court ruling that the legislation is lawful.
They said that ISPs will have to pay 25% of the qualifying costs incurred by media regulator Ofcom in running and setting up an appeals body for alleged illicit filesharers.
They confirmed that the ISPs should pay 25% of relevant costs, which are operating fees incurred when identifying which subscribers are accused of illegal downloading.
The judges overturned a previous high court ruling which said that the ISPs have to pay 25% of case fees that are charged by the proposed appeals body.
Rights holders have agreed to foot 75% of the costs in each of the three fees.
The court of appeal also ruled that BT and TalkTalk must pay 93% of the costs of the legal challenge, a figure understood to have run into six figures.