Google Inc., owner of the world's biggest search engine, bought a San Francisco office building and agreed to lease space at a nearby tower as it expands its real estate presence in the city.

Google purchased 188 The Embarcadero from Ares Management LP and USAA Investment Management Co. for $65 million in a transaction completed, said two people with knowledge of the deal, who asked not to be identified because the details are private. The company also will lease 250,000 square feet at the 42-story Spear Tower in the One Market Plaza complex.

"We are excited to expand in San Francisco, and we will continue to work hard to be a good neighbor in the communities where we work and live," said Caitlin Adair, a Google spokeswoman, who confirmed the purchase and lease but declined to give details.

The deals give the Mountain View company a cluster of offices within blocks of each other near San Francisco's waterfront. The eight-story Embarcadero property sits at the corner of the bayside boulevard and Howard Street, within view of the landmark Ferry Building. It's about two blocks from Hills Plaza, Google's main offices in the city.

Margot Olcay, a spokeswoman for USAA, confirmed The Embarcadero building was sold and declined to comment further. Bill Mendel, spokesman for Ares, declined to comment, as did Ted Koltis, senior vice president for Paramount Group Inc., Spear Tower's majority owner.

It's not clear what Google's plans are for the new space. The Embarcadero property has about 88,000 square feet and is two-thirds empty, said a person familiar with the deal.

At the Spear Tower building, Google will occupy floors two through 16, according to the person with knowledge of the lease. The tower is the biggest component of the One Market Plaza office complex. Blackstone Group LP bought a 49 percent stake in the property earlier this year.