Apple Inc. (Nasdaq: AAPL) agreed to acquire music-identification service Shazam, taking ownership of one of the first apps to demonstrate the power of the iPhone, recognizing songs after hearing just a few bars of a tune.

Terms of the deal weren’t disclosed, but a person familiar with the situation said Apple is paying about $400 million for the U.K.-based startup. That would be one of Apple’s largest acquisitions ever, approaching the size of its 1996 purchase of Next Computer Inc. which brought co-founder Steve Jobs back to the company. That transaction would be worth more than $600 million in today’s dollars.

The acquisition of Shazam isn't the first deal the buyer has engaged in to boost its mobile operations. Apple also acquired WifiSlam in 2013 for $20 million, according to reports.

The deal announced Monday will be a disappointment for some of Shazam Entertainment Ltd.’s investors, including Mexican billionaire Carlos Slim and venture capital firms Kleiner Perkins Caufield & Byers, Institutional Venture Partners and DN Capital Ltd. The 18-year-old company, which has required twice the average time to deliver an exit for backers, was valued at about $1 billion when it closed its last funding round in 2015.

"A company isn’t worth a billion dollars until it’s sold or exited. Many of these so-called unicorns are of course fakies," Mark Tluszcz, co-founder of VC firm Mangrove Capital Partners and chairman of website building service Wix.com Ltd. "They will face their day of reckoning and may turn out to be a disappointment. The case of Shazam will serve as a stark warning to other companies."

The Shazam app uses the microphone on a smartphone or computer to identify almost any song playing nearby, then points users to places they can listen to it in future, such as Apple Music or Google’s YouTube.

While Shazam has been popular with customers, it struggled turning its clever music service into a business that justified its valuation. It expanded beyond simple audio recognition in 2010 by adding capabilities that let television viewers "Shazam" an ad, which would then open a promotion from the advertiser on a user’s device. The company said this feature was used 700,000 times during the 2014 Super Bowl broadcast.

"Apple Music and Shazam are a natural fit, sharing a passion for music discovery and delivering great music experiences to our users," Apple said in an emailed statement on Monday. "We have exciting plans in store, and we look forward to combining with Shazam upon approval of today’s agreement."

In November, Shazam had about 175 million monthly active users globally across iOS and Android, according to research firm App Annie. The U.S. is the largest single market, with about 20 million active users in November, while the U.K. had about 4 million in the same month.

"Since the launch of the App Store, Shazam has consistently ranked as one of the most popular apps for iOS," Apple also said. "Today, it’s used by hundreds of millions of people around the world, across multiple platforms."

The acquisition would help Apple embed that capability more deeply into its music offerings. The company’s digital assistant Siri gained Shazam integration in 2014, so users could ask it what song is playing in the background.

Additional Reporting By Mergers and Acquisitions' Kamaron Leach