The deal is expected to close by early next year subject to approval by regulators.
This strengthens the existing partnership between the two: HTC was behind Google's first smartphones - the Pixel and Pixel XL - launched last year.
The Google-HTC partnership
What are Google and HTC getting under the deal?
Under the agreement, Google will employ no stake in HTC, but 2,000 employees of the latter who worked on the Pixel phones will move to the former.
"The deal also includes a non-exclusive license for HTC intellectual property," Google announced.
Meanwhile, HTC will continue with its own smartphone business.
What's in it for Google?
The deal could work out much in Google's favor: HTC, a brand which doesn't even make the top-five in smartphones, handled the well-received Pixels.
It can now directly challenge Android partners like LG and Huawei.
The deal could take it closer to the software-hardware energy it is aiming: with a push on VR and AR, Google will need stronger, more powerful hardware and sensors.
Love Business news?
Stay updated with the latest happenings.
How does it benefit HTC?
Meanwhile, the agreement is gold for HTC, a Taiwanese giant which once sold one in every 10 smartphones worldwide.
Today, it is struggling to "maintain its smartphone business and grow its early start in virtual reality". The Pixel smartphones account for roughly 20% of HTC's smartphone shipments.
In August'17, the brand posted an operating loss for the second fiscal quarter.
Google's history in hardware
This is Google's second foray into the smartphone market. In 2012, it acquired Motorola Mobility for $12.5bn.
Under Google, Motorola opened a US plant and offered unprecedented customization options for Moto X.
But less than two years later, Google sold it to Lenovo for at a price far lower.
Afterwards, it partnered with smartphone makers for handsets that ran Google-managed version of Android.
HTC's decade-long association with Google
Meanwhile, it has been a decade of HTC's association with Google and Android: the HTC Dream, also called the G1, launched in 2008 was the first-of-its-kind commercial Android device. Then it helped Google with the Nexus range of products before the Pixel last year.
So will this deal work out well?
There are reasons to be doubtful. Google has a weak record in selling smartphones. Both with the Nexus and Pixel, it promoted the Google-managed version of Android.
But neither could match market leaders Apple or Samsung in terms of sales.
For now, it is concentrating on the upcoming launch of the HTC-made Pixel 2 and Pixel 2 XL along with other hardware products.
Patanjali eyes Rs. 700cr deal: Second win in two months
New iPhones to launch in India on September 29 evening