SACRAMENTO — State lawmakers advanced a proposal to make it harder for local officials to block construction of apartment buildings around public transit after its author agreed Wednesday to carve out separate rules for more lightly populated counties.

Sen. Scott Wiener, the San Francisco Democrat behind the bill to spur denser housing development in California cities, announced a deal with Sen. Mike McGuire that folded the Healdsburg Democrat’s similar but more limited measure into Wiener’s SB50.

The combined bill, which passed the Senate Governance and Finance Committee with bipartisan support, would allow residential buildings of at least four or five stories within half a mile of rail stations and ferry terminals, provided those projects meet other local design standards.

Wiener agreed to limit the rules changes to counties with more than 600,000 people. There are 15 counties in California that qualify, including San Francisco, Alameda, Contra Costa, San Mateo and Santa Clara.

The bill would also remove density limits within a quarter-mile of stops on bus lines with frequent service and in high-income census tracts with lots of jobs and good schools, regardless of their proximity to transit. That would open neighborhoods previously zoned for single-family homes to apartments and condominiums.

The new SB50 creates an exemption to the proposed rules for coastal zones in cities with fewer than 50,000 people, areas at high risk of fire and state-designated historic districts.

“We need to move away from this notion that housing is somehow a punishment,” Wiener said at the committee hearing, where city officials and affordable-housing advocates lined up against the bill.

“We are making it harder for working families to be able to survive and thrive,” he said.

For counties with a population of less than 600,000, including Sonoma and Marin in McGuire’s district, the new bill adopts provisions laid out in the North Bay senator’s now-abandoned competing measure, SB4.

Those provide a streamlined approval process and allow up to one extra story for buildings within a half-mile of transit stops, but only in cities with more than 50,000 people. Rural and suburban communities in the smaller counties would be exempt.

Throughout the state, SB50 would create an expedited process to convert vacant plots and homes in residential areas to apartment buildings of up to four units.

McGuire said that what works for downtown Los Angeles does not necessarily work for Santa Rosa, but that all cities must do their part to address a shortage of housing in the state.

“No community should see dramatic change, but every community should see some change,” he said. “I do believe this bill is trying to strike that balance.”

But SB50 is likely to encounter continued stiff opposition from local officials as it moves to another committee vote and then potentially the Senate floor. The San Francisco Board of Supervisors is among the local government bodies that have come out against the bill, though Mayor London Breed supports it.

David Reyes, the director of planning and community development for Pasadena, objected to state lawmakers imposing requirements that would limit local residents’ ability to establish their own zoning rules.

“What cities will do in response to a bill like this is sue the state,” he said.

Groups advocating for tenants rights also remain skeptical of SB50, which they argue will prioritize luxury developments over affordable housing.

Dozens of opponents showed up at Wednesday’s hearing, led by members of Housing Is a Human Right. The group, backed by AIDS Healthcare Foundation founder Michael Weinstein, sent out a mailer this month comparing SB50 to San Francisco’s urban renewal policies that razed largely African American neighborhoods in the mid-20th century.

René Moya, director of Housing Is a Human Right, said Wiener’s bill would “further fuel the engine of gentrification that is displacing working-class communities of color in California.”

SB50 does not extend its development benefits to sites with housing that renters have occupied within the previous seven years or that the owners have pulled from the rental market through Ellis Act evictions in the previous 15 years.

It includes a process for neighborhoods with large numbers of poor residents to establish their own zoning rules and a requirement that apartment projects include affordable units. In his revised bill, Wiener committed to working with housing advocates to determine what percentage of units should be set aside for low-income people.

“Displacement happens when people get pushed out because housing costs go through the roof because we don’t have enough housing,” Wiener said. He said California needs to build housing of all types to address a shortage estimated at more than 3 million homes.

Alexei Koseff is a San Francisco Chronicle staff writer. Email: alexei.koseff@sfchronicle.com Twitter: @akoseff