San Francisco’s Ferry Building, an 1898 landmark that has become a prime spot for restaurants and food shops as well as offices, has changed hands for $291 million.

Hudson Pacific Properties, a major West Coast tech landlord, and German insurance giant Allianz are the new proprietors.

The companies want to expand the farmers market, which the building hosts three times a week. They also want to open the building’s 245-foot tower to the public for the first time in years.

“It’s such a beautiful iconic piece,” Victor Coleman, CEO of Hudson Pacific Properties, said Monday. “We’d like it to be accessible for San Franciscans and tourists alike.”

The Port of San Francisco, a city agency, owns the Ferry Building but has leased it to private developers since 2001. Hudson Pacific Properties and Allianz said they bought the rights to a 49-year building lease from the Blackstone Group’s Equity Office division, giving them control over the property.

The deal, at a price exceeding $1,000 per square foot, is another sign of San Francisco’s booming office market, which has been largely driven by the growth of the tech industry.

Hudson Pacific Properties, which went public in 2010, owns other tech hubs, including 1455 Market St., the headquarters of Uber and Square, and Rincon Center, home to some of Google’s San Francisco offices.

The property includes 192,532 square feet of office space and 75,486 square feet of retail. The office space is fully leased, to SS&C Technologies, Meltwater, Meritage Group and Niantic, maker of the “Pokémon Go” video game. Retail and restaurant tenants include Blue Bottle Coffee, Cowgirl Creamery and the Slanted Door.

Coleman said leases will expire in 2019 for about 40,000 square feet of office space, giving Hudson Pacific Properties and Allianz the opportunity to raise rents. Existing rents are almost 50 percent below current market rates, he said.

San Francisco’s average downtown asking rents are over $80 per square foot annually, and waterfront space like the Ferry Building can command over $100 per square foot, according to real estate brokerage data. Coleman declined to disclose the Ferry Building’s exact rents.

Before the Bay Bridge connected San Francisco and Oakland in 1936, the Ferry Building was the primary destination for arriving visitors. Over the decades, the building survived earthquakes big and small, along with attempts to demolish it for larger structures.

In the 1950s, the Embarcadero Freeway cut the waterfront and Ferry Building off from the rest of the city. The freeway was demolished after the 1989 Loma Prieta earthquake. Starting in 2001, Equity Office and Wilson Meany renovated the vacant Ferry Building for $90 million and reopened it in 2003 as a food hall and office space.

The renovations restored the building to its former glory as a nexus for travelers and tourists, and the last decade has seen a rebound in ferry ridership. San Francisco is now investing in additional ferry service on the Embarcadero, which will triple the amount of water traffic in the area. Foot traffic at the Ferry Building is expected to rise from 14,000 daily commuters to 24,000, said Coleman.

“Since it opened in 1898, the Ferry Building has been preserved and improved, evolving into a great architectural achievement,” said Christoph Donner, CEO of Allianz Real Estate of America, in a statement. “Visitors, vendors and tenants are attracted by its unparalleled offerings.”

Under the deal, Hudson Pacific Properties controls a 55 percent stake in the Ferry Building and Allianz controls 45 percent. The agreement requires a payment of $1.6 million per year in rent to the Port of San Francisco, rising with inflation.

Coleman said the companies will pursue other real estate investments together in the Bay Area, Seattle and Los Angeles.

Blackstone acquired Equity Office in 2007 at the peak of real estate bubble for $39 billion — the largest leveraged buyout at the time. The private equity giant has since sold off many of Equity’s properties, and the Ferry Building was the last remnant of its portfolio from the early 2000s.

Blackstone remains an active investor in San Francisco. It has partial ownership in One Market Plaza, home to Google, Autodesk and Visa. It also owns the headquarters of Charles Schwab at 211 Main St. and is in contract to buy Embarcadero Place, a few blocks west of the Ferry Building.

Coleman said he’s had a relationship with Blackstone for two decades, and that helped Hudson Pacific complete the deal for the Ferry Building.

“The history is second to none,” Coleman said. “It really is one of my favorite pieces of real estate in all of San Francisco. Where can you stand in an office building and see the water right below you?”

Roland Li is a Chronicle staff writer. Email: roland.li@sfchronicle.com Twitter: @rolandlisf