Fifteen months after the Board of Supervisors killed a deal to sell a city office building at 30 Van Ness Ave. for $80 million, a new buyer has agreed to pay $10 million less for the property but include a lot more affordable housing in a future project.

Under the agreement, which must be approved by the Board of Supervisors, the Australian developer Lend Lease would pay the city $70 million for the property, which currently houses the Department of Public Works and other city agencies. Lend Lease has agreed to make 25 percent of the units affordable. In addition, the developer has committed to paying the city an additional affordable-housing fee of about $8 million — if, as expected, the city increases the height limit on the site from 400 to 500 feet.

The 30 Van Ness sale is at the center of a complicated chain of real estate transactions, all aimed at funding a new 460,000-square-foot city office building at 1500 Mission St., now the site of a Goodwill store. The new office building will house the Department of Public Works, the City Planning Department and the Department of Building Inspection, creating a one-stop shop for property-related planning and permitting.

In addition to selling 30 Van Ness, the city has reached an agreement to sell 1660 and 1680 Mission St., currently home to planning and building departments, for $52 million. The buyer is SF Prosperity II, a real estate investment fund run by Michael Wang. The combined $122 million generated by the sales matches the city’s goal needed to make the new $327 million office building financially feasible, according to Department of Real Estate Director John Updike.

“We hit our target,” Updike said. “That’s what this process has always been all about. We’ll be able to bring our employees into a newer, safer building where they can be more efficient. And at the same time we meet the city’s policy goals in terms of a great future development at 30 Van Ness, with the extra affordability.”

While the $70 million is actually $17 million less than the $87 million minimum bid the city had originally set when the property went on the market in April 2015, Updike said the value of the increased affordable housing that will be built at 30 Van Ness makes it a good deal for the city.

And for now it seems that the Department of Real Estate has something that was lacking the last time the 30 Van Ness property was in contract: political support. In December 2015, Supervisors Aaron Peskin and Jane Kim led the effort to halt the sale of the parcel to Related of California for $80 million, saying the offer was too low and did not include enough affordable housing.

While the new offer is even lower, the extra affordable-housing commitment more than makes up for the depressed price point, according to Kim and Peskin. Related had guaranteed that 15 percent of its units would be affordable. Assuming that a 400-unit rental project is erected in a 500-foot tower on the site, the difference between the number of affordable units the two deals would generate would be 40 units, plus the $8 million that would be donated to the Mayor’s Office of Housing and Community Development.

“It was worth the wait,” Peskin said. “There was a broad consensus that less money and a lot more affordable housing was what we wanted.”

Kim said the increased level of affordable housing — along with the additional housing fee — is consistent with two recent successful ballot measures: last year’s Proposition C, which called for private developers to make 25 percent of units affordable, and Proposition K, the nonbinding 2015 ballot measure that called for 33 percent low- and middle-income housing on public land.

“When the city has site control, we should be building at higher levels of affordability than when it’s on private land,” Kim said, adding that accepting $10 million less on the land deal to get from “15 percent to a minimum of 25 percent affordable is unheard-of.”

Peter Cohen, co-director of the Council for Community Housing Organizations, said that the city should have insisted on 33 percent affordable housing on site, rather than 25 percent and the fee.

“Is the city going to prioritize creating maximum affordable housing on the land it owns?” said Cohen. “That is what we think they should be aiming for.”

For the city’s Department of Real Estate, the urgency is to own its own space so that it is no longer subject to the whims of a fickle private leasing market. For 20 years, the city has been looking at either buying or constructing an office building in the Civic Center area.

Over the past six years, with the arrival of tech companies like Twitter, Dolby, Square and Uber, the Civic Center and Mid-Market areas have gone from the city’s weakest office sub-market to one of its strongest. That shift has pushed rents up and curtailed opportunities for the city to buy or develop a facility, said Updike. The city unsuccessfully tried to buy 1295 Market St. — Dolby got it — as well as 1455 Market St. and 100 Van Ness Ave., which were snapped up by developers.

“We have tried and tried and tried and have run out of those kind of large boxes or opportunities to build them,” said Updike.

Meanwhile, the structure at 30 Van Ness is deteriorating. It needs a new skin, mechanical systems and a seismic upgrade — a $60 million investment. The deal at both 30 Van Ness and 1660-1680 Mission call for the city to lease back the space for three years.

“It’s not a terrific building,” Updike said. “It’s functionally obsolescent. It has seismic challenges. That is reflected in each of the prospective buyers over the last two years as they kicked the tires.”

While there was risk that the market would tank during the 15-month delay, interest was just as strong this time around, according to Kyle Kovac, a broker with Newmark Cornish & Carey, who represented the city in the sale.

“You can always point to negative clouds on the horizon, but the location — on top of a Muni stop at Market and Van Ness — sort of overrode any concerns. It’s such a rare opportunity.”

The 1500 Mission St. project, which will be built by Related, will go to the Planning Commission for approvals on March 23. In addition to the city office building, that development will include about 500 housing units. The two towers will share a podium and be built at the same time. The city plans to move into the new office building in May 2020. Even though the 1500 Mission St. is not yet approved, the city and Related have been working on construction permits so that work can start as soon as the project is approved.

“We have a need for speed here,” said Updike.

J.K. Dineen is a San Francisco Chronicle staff writer. Email: jdineen@sfchronicle.com Twitter: @sfjkdineen