An attendant shows a Fitbit Inc. Ionic smartwatch for a photograph at the Wearable Expo in Tokyo, on Jan. 18, 2018. (Kiyoshi Ota/Bloomberg News)

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.