The so-called malvertising affected Spotify's subscription-free service on Windows, Mac and Linux machines.
People reported that virus-infected pop-up websites were appearing while they listened to music.
Spotify said in a statement: "We have now identified the source of the problem and have shut it down."
It said "questionable website pop-ups" had affected a "small number of users".