Fitbit on Friday announced it will be acquired by Google in a deal that values the smartwatch maker at roughly $2.1 billion.

The deal puts Alphabet, Google’s parent company, in a race against Apple when it comes to tracking fitness and health data. Fitbit’s stock had surged as much as 30 percent earlier this week on reports that Alphabet had put in an offer. The deal is expected to close in 2020.

Google will pay $7.35 a share for the fitness tracker, helping it advance its ambitions for wearable technology. The company does not make its own smartwatch.

Fitbit stock surged 16 percent after the announcement. Like comparable products manufactured by Garmin, Apple and Samsung, the Fitbit gives consumers immediate access to ever-more-specific slices of fitness data — from their daily step count to their heart rate to how well they sleep. Yet the data has also become a treasure trove for employers and insurance companies, complicating the relationships between workers and their bosses.

“Fitbit has been a true pioneer in the industry and has created terrific products, experiences and a vibrant community of users,” said Rick Osterloh, senior vice president of devices and services at Google. “We’re looking forward to working with the incredible talent at Fitbit, and bringing together the best hardware, software and AI, to build wearables to help even more people around the world.”

Even though the deal could grant Google a big boost in a market where it has long lagged, it could also raise regulatory headaches for the tech giant. The companies indicated in their securities filings they would probably need to obtain approval from antitrust watchdogs to consummate the merger — a process that arrives precisely as all of Silicon Valley is under the political microscope in Washington for being too big and powerful.

Google in particular is the subject of competition investigations by federal and state officials, which are focused in large part on its advertising business. As part of its merger terms, Google has agreed to pay $250 million to Fitbit if it can’t secure regulators’ blessings, a move that some analysts saw as a critical warning sign.

“This deal is going to get a bright spotlight from regulators in the Beltway, which speaks to such a high termination fee,” said Daniel Ives, managing director for equity research at Wedbush Securities. “Google knows politicians and regulators have the company in their sights with another battle now on the horizon in this Big Tech versus Beltway theme.”

Regulators could be particularly interested in privacy: Google collects a trove of data about the users of its services — including its search and email systems — and smartphones and smart-home devices. In doing so, the company often has found itself in the crosshairs of Congress and a slew of government agencies around the world for failing to protect that personal information.

Fitbit, however, stressed that health and wellness data will not be used for Google ads.

“Strong privacy and security guidelines have been part of Fitbit’s DNA since day one, and this will not change,” the company said in its Friday release. “Fitbit will continue to put users in control of their data and will remain transparent about the data it collects and why.”

Antitrust regulators have been “slow to the game” when it comes to looking at how data plays into fortifying monopoly power, said Sally Hubbard, the director of enforcement strategy at Open Markets Institute, which has advocated for tougher competition enforcement against tech giants.

“That’s a source of their dominance,” Hubbard said. “The reason no one else can really challenge Google in targeted advertising is because no one has the surveillance network Google has. … So I think antitrust enforcers need to take a really hard look at whether they should allow Google to acquire another unique data set.”

Apple has posed serious competition for Fitbit. At the end of last year, Apple owned roughly half the world’s smartwatch market in terms of units shipped.

When reporting company earnings in July, Fitbit lowered its guidance for the year, citing lagging sales of the new lightweight model, Versa Lite. Fitbit has more than 28 million active users worldwide.