The largest record labels are closing in on a deal for a stake in buzzy digital-music service SoundCloud Ltd., in exchange for an agreement not to sue the startup for copyright violations, according to people with knowledge of the plans.

SoundCloud, a Berlin-based company with more than 250 million listeners a month, is negotiating with Universal Music Group, Sony Music Entertainment and Warner Music Group for licenses to continue playing songs from the biggest labels and avoid potential legal disputes, said people familiar with the talks. In return, SoundCloud is discussing giving each record label a roughly 3 percent to 5 percent stake, along with a percentage of future revenue, said the people, who asked not to be identified because the talks are private.

An agreement would value SoundCloud at $500 million to $600 million, two people familiar with the talks said. The company was valued at about $700 million in an investment round earlier this year, said one person, a discrepancy that could be attributed to the licensing deals being different than a traditional venture capital-like investment. The timing of an announcement with the labels is in flux because some of the music companies are closer to a deal with the startup than others, two people said.