Music fans who bought CDs with Sony's controversial XCP copy control software are set to get refunds.

A US federal judge gave final approval to a class action lawsuit that was brought against the entertainment company after Sony included a pair of invasive and potentially dangerous copy protection programs on an estimated 15 million music CDs.

The agreement ends one chapter in a public relations disaster for the entertainment company, which must still contend with a lawsuit brought against it by the state of Texas for violation of state anti-spyware laws.

Sony was sued in three separate class action lawsuits, which were consolidated into Monday's settlement. The suits were launched in November 2005, soon after computer science researchers disclosed that Sony's XCP software used dangerous "rootkit" techniques to cloak itself after installation. Sony licensed the XCP software from British-based First 4 Internet.

Rootkit software is normally used by hackers to hide their malware from system tools and antivirus products, and Sony was widely criticised for using this potentially dangerous software.

With its approval of the deal on Monday, the court finalised a tentative agreement reached between Sony and the plaintiffs in December.

Under terms of the settlement, people who purchased XCP-protected CDs can apply for either a cash payment of US$7.50 plus a free album download, or three album downloads, whichever they prefer.

"This settlement gets music fans what they thought they were buying in the first place: music that will play on all their electronic devices without installing sneaky software," said Cindy Cohn, legal director of the Electronic Frontier Foundation (EFF). The EFF represented plaintiffs in the case.

Sony issued a statement Monday saying it was pleased with the settlement.

Computer science researchers also found problems with another type of software Sony put on some CDs, called MediaMax. That software, written by SunnComm International, installs software without the user's permission, is difficult to uninstall, and surreptitiously transmits information about users activities to SunnComm's servers.

Customers who bought MediaMax CDs can now get free downloads.