Fitbit stock soared to near 10 percent on Monday after the company announced a health-care collaboration with Alphabet's Google.

The stock later gave up about half the gain.

The wearables company announced on Monday that it plans to use Google's Cloud Healthcare API to help the company integrate further into the health-care system. The technology allows doctors and other health workers to see a more complete profile of patients by connecting Fitbit data with electronic medical records.

Fitbit's partnership with Google is the next step in a journey to integrating health care and wearables. Fitbit recently acquired Twine Health, which offers services like health coaching in the workplace to help manage chronic conditions like diabetes and hypertension.

Fitbit says that using Google's Cloud Platform will also allow it to scale faster while also remaining secure and protecting privacy.

"Google gives us an opportunity to transform how we scale our business, allowing us to reach more people around the world faster, while also enhancing the experience we offer to our users and the healthcare system," Fitbit co-founder and CEO James Park said in a statement.

The new focus on health may make Fitbit a stronger competitor in the wearables market. The new health venture comes after competitor Apple announced a tighter focus on health with its smartwatch. The Apple Watch's sales have steadily grown the past four quarters, and it just had its best quarter ever.

Fitbit has had a tough year. The company's earnings release in February revealed that it is losing money and expects revenue to decline further in the upcoming year. It expects that "consumer demand shifting towards smartwatches" (like the Apple Watch) will hurt sales even further.

The stock was down 2.7 percent for the year at market close on Monday.