Apple Music is on the verge of overtaking Spotify AB in U.S. paid subscribers, a sign that the music-streaming world’s dominant force is facing growing competition ahead of its hotly anticipated public stock offering.

Apple Inc.’s streaming-music service, introduced in June 2015, has been adding subscribers in the U.S. more rapidly than its older Swedish rival—a monthly growth rate of 5% versus 2%—according to people in the music business familiar with figures reported by the two services. Assuming that pace continues, Apple will overtake Spotify in the world’s biggest music market this summer.

Apple’s music-streaming service has been quietly gaining ground in part thanks to the popularity of the company’s devices: Apple Music comes preloaded on all iPhones, Apple Watches and other hardware the company sells.

Globally, however, Spotify remains in a league of its own, with nearly twice as many paid subscribers as No. 2 Apple, and slightly faster subscriber growth. Other players in paid streaming music include Pandora Media Inc., Amazon.com Inc. and Alphabet Inc.’s YouTube.

Streaming services have fueled a recovery in the recording industry after years of declines amid plummeting sales of CDs and, more recently, downloads. Streaming customers pay a flat monthly fee or listen to ads in exchange for unlimited access to vast music catalogs; with downloads, consumers pay for individual songs or albums once and own them permanently. Paid subscriptions, up 61%, were the largest source of record-company revenue in the U.S. in the first half of 2017, according to the Recording Industry Association of America.