The announcement of the settlement came as testimony began in the damages phase of a trial in Manhattan that had already determined MP3.com willfully violated copyrights. U.S. District Judge Jed S. Rakoff announced the deal in court after lawyers completed 48 hours of intensive negotiations. Hadrian Katz, Universal’s lawyer, declined to comment outside court.

MP3.com chief executive Michael Robertson, looking weary but happy, said his company had secured rights to Universal’s entire catalog of music.

Under the deal, Universal agreed to buy warrants for the rights to buy MP3.com shares, a vote of confidence in the future of the Internet startup.

Robertson said Universal had agreed to buy an unspecified number of warrants at a price higher than the value of MP3.com’s stock prior to the deal being announced in court, a recognition of how low the value had fallen.

“Our shareholder’s should be excited about today’s development,” Robertson said. “It really moves us forward. It gets us out of the courtroom and into the business of delivering digital music.”

Shares of MP3.com rose 63 cents, or 18 percent, to $4 on the Nasdaq Stock Market.

Earlier, MP3.com had settled with the other four large record companies – Warner Music Group, BMG, EMI and Sony Music Entertainment – and had arranged licensing deals with each of them.

The amount of those settlements has not been disclosed, but Robertson said the total, including Universal, falls within the $170 million the company set aside for legal costs. Some lawsuits with smaller labels remain to be resolved but were not expected to be a threat to MP3.com’s ability to stay in business.

The lawsuits were filed after MP3.com created an online catalog of 80,000 CDs for its MyMP3.com listening service, which allows customers to hear CDs from anywhere once they prove they own them by inserting them into a computer.

Judge Rakoff ruled in September that MP3.com had intentionally violated the copyrights of the music companies. He had awarded Universal $25,000 per CD, but the number of CDs at stake was yet to be determined. Universal said it was up to 10,000 CDs – making MP3.com potentially liable to pay up to $250 million in damages. MP3.com maintained the number of CDs involved was less than 5,000.