The Internet music-swapping service has agreed to sell its assets to Bertelsmann for $8 million in cash and the assumption of certain liabilities, according to papers filed in a Wilmington, Del. court.

Those liabilities include any new loans to Napster and forgiveness of the $91 million Bertelsmann loaned Napster before the filing, Napster’s bankruptcy lawyer Rick Cieri said.

After the bankruptcy process is complete, Napster will sell itself to Bertelsmann, unless another company submits a higher bid, Cieri said.

“The Chapter 11 process is going to be utilized to maximize the value of Napster, whether by a sale to Bertelsmann or someone else,” Cieri said.

Calls to a Napster spokeswoman were not immediately returned Monday.

Bertelsmann said May 17 it would buy Napster for $8 million – slightly more than half what it had previously offered to purchase the company – to pay Napster’s creditors as part of a financial reorganization. Napster’s board rejected that offer.

As of April 30, Napster had about $7.9 million in assets and about $101 million in liabilities, according to the filings.

The bankruptcy filing is the swan song for a company that three years ago set off a frenzy of online song-swapping that attracted millions of users, as well as the ire of the recording industry, which sued for copyright infringement.

At its peak, Redwood City-based Napster boasted some 60 million users and seemed at once to symbolize both the excitement of the digital revolution and the worst nightmares of the established recording industry.