Internet radio, once on its deathbed, is likely to survive after all.

On Tuesday, after a two-year battle, record labels and online radio stations agreed on new royalty rates that cover music streaming.

Many of the music sites had argued that the old rates were so high that they were being forced out of business. That could have come back to haunt the record labels, since for many people the sites are becoming a useful way to discover music.

“This is definitely the agreement that we’ve been waiting for,” said Tim Westergren, the founder of Pandora, one of the most popular Internet radio sites with 30 million registered users.

In 2007 a federal royalty board ruled that all so-called webcasters needed to pay a fee, set to increase to 0.19 cent a song next year, each time they streamed a song for a listener.